3 #ifndef PY_SSIZE_T_CLEAN
4 #define PY_SSIZE_T_CLEAN
8 #error Python headers needed to compile C extensions, please install development version of Python.
9 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
10 #error Cython requires Python 2.6+ or Python 3.3+.
12 #define CYTHON_ABI "0_29_24"
13 #define CYTHON_HEX_VERSION 0x001D18F0
14 #define CYTHON_FUTURE_DIVISION 0
17 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
19 #if !defined(WIN32) && !defined(MS_WINDOWS)
31 #define DL_IMPORT(t) t
34 #define DL_EXPORT(t) t
37 #ifndef HAVE_LONG_LONG
38 #if PY_VERSION_HEX >= 0x02070000
39 #define HAVE_LONG_LONG
43 #define PY_LONG_LONG LONG_LONG
46 #define Py_HUGE_VAL HUGE_VAL
49 #define CYTHON_COMPILING_IN_PYPY 1
50 #define CYTHON_COMPILING_IN_PYSTON 0
51 #define CYTHON_COMPILING_IN_CPYTHON 0
52 #undef CYTHON_USE_TYPE_SLOTS
53 #define CYTHON_USE_TYPE_SLOTS 0
54 #undef CYTHON_USE_PYTYPE_LOOKUP
55 #define CYTHON_USE_PYTYPE_LOOKUP 0
56 #if PY_VERSION_HEX < 0x03050000
57 #undef CYTHON_USE_ASYNC_SLOTS
58 #define CYTHON_USE_ASYNC_SLOTS 0
59 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
60 #define CYTHON_USE_ASYNC_SLOTS 1
62 #undef CYTHON_USE_PYLIST_INTERNALS
63 #define CYTHON_USE_PYLIST_INTERNALS 0
64 #undef CYTHON_USE_UNICODE_INTERNALS
65 #define CYTHON_USE_UNICODE_INTERNALS 0
66 #undef CYTHON_USE_UNICODE_WRITER
67 #define CYTHON_USE_UNICODE_WRITER 0
68 #undef CYTHON_USE_PYLONG_INTERNALS
69 #define CYTHON_USE_PYLONG_INTERNALS 0
70 #undef CYTHON_AVOID_BORROWED_REFS
71 #define CYTHON_AVOID_BORROWED_REFS 1
72 #undef CYTHON_ASSUME_SAFE_MACROS
73 #define CYTHON_ASSUME_SAFE_MACROS 0
74 #undef CYTHON_UNPACK_METHODS
75 #define CYTHON_UNPACK_METHODS 0
76 #undef CYTHON_FAST_THREAD_STATE
77 #define CYTHON_FAST_THREAD_STATE 0
78 #undef CYTHON_FAST_PYCALL
79 #define CYTHON_FAST_PYCALL 0
80 #undef CYTHON_PEP489_MULTI_PHASE_INIT
81 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
82 #undef CYTHON_USE_TP_FINALIZE
83 #define CYTHON_USE_TP_FINALIZE 0
84 #undef CYTHON_USE_DICT_VERSIONS
85 #define CYTHON_USE_DICT_VERSIONS 0
86 #undef CYTHON_USE_EXC_INFO_STACK
87 #define CYTHON_USE_EXC_INFO_STACK 0
88 #elif defined(PYSTON_VERSION)
89 #define CYTHON_COMPILING_IN_PYPY 0
90 #define CYTHON_COMPILING_IN_PYSTON 1
91 #define CYTHON_COMPILING_IN_CPYTHON 0
92 #ifndef CYTHON_USE_TYPE_SLOTS
93 #define CYTHON_USE_TYPE_SLOTS 1
95 #undef CYTHON_USE_PYTYPE_LOOKUP
96 #define CYTHON_USE_PYTYPE_LOOKUP 0
97 #undef CYTHON_USE_ASYNC_SLOTS
98 #define CYTHON_USE_ASYNC_SLOTS 0
99 #undef CYTHON_USE_PYLIST_INTERNALS
100 #define CYTHON_USE_PYLIST_INTERNALS 0
101 #ifndef CYTHON_USE_UNICODE_INTERNALS
102 #define CYTHON_USE_UNICODE_INTERNALS 1
104 #undef CYTHON_USE_UNICODE_WRITER
105 #define CYTHON_USE_UNICODE_WRITER 0
106 #undef CYTHON_USE_PYLONG_INTERNALS
107 #define CYTHON_USE_PYLONG_INTERNALS 0
108 #ifndef CYTHON_AVOID_BORROWED_REFS
109 #define CYTHON_AVOID_BORROWED_REFS 0
111 #ifndef CYTHON_ASSUME_SAFE_MACROS
112 #define CYTHON_ASSUME_SAFE_MACROS 1
114 #ifndef CYTHON_UNPACK_METHODS
115 #define CYTHON_UNPACK_METHODS 1
117 #undef CYTHON_FAST_THREAD_STATE
118 #define CYTHON_FAST_THREAD_STATE 0
119 #undef CYTHON_FAST_PYCALL
120 #define CYTHON_FAST_PYCALL 0
121 #undef CYTHON_PEP489_MULTI_PHASE_INIT
122 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
123 #undef CYTHON_USE_TP_FINALIZE
124 #define CYTHON_USE_TP_FINALIZE 0
125 #undef CYTHON_USE_DICT_VERSIONS
126 #define CYTHON_USE_DICT_VERSIONS 0
127 #undef CYTHON_USE_EXC_INFO_STACK
128 #define CYTHON_USE_EXC_INFO_STACK 0
130 #define CYTHON_COMPILING_IN_PYPY 0
131 #define CYTHON_COMPILING_IN_PYSTON 0
132 #define CYTHON_COMPILING_IN_CPYTHON 1
133 #ifndef CYTHON_USE_TYPE_SLOTS
134 #define CYTHON_USE_TYPE_SLOTS 1
136 #if PY_VERSION_HEX < 0x02070000
137 #undef CYTHON_USE_PYTYPE_LOOKUP
138 #define CYTHON_USE_PYTYPE_LOOKUP 0
139 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
140 #define CYTHON_USE_PYTYPE_LOOKUP 1
142 #if PY_MAJOR_VERSION < 3
143 #undef CYTHON_USE_ASYNC_SLOTS
144 #define CYTHON_USE_ASYNC_SLOTS 0
145 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
146 #define CYTHON_USE_ASYNC_SLOTS 1
148 #if PY_VERSION_HEX < 0x02070000
149 #undef CYTHON_USE_PYLONG_INTERNALS
150 #define CYTHON_USE_PYLONG_INTERNALS 0
151 #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
152 #define CYTHON_USE_PYLONG_INTERNALS 1
154 #ifndef CYTHON_USE_PYLIST_INTERNALS
155 #define CYTHON_USE_PYLIST_INTERNALS 1
157 #ifndef CYTHON_USE_UNICODE_INTERNALS
158 #define CYTHON_USE_UNICODE_INTERNALS 1
160 #if PY_VERSION_HEX < 0x030300F0
161 #undef CYTHON_USE_UNICODE_WRITER
162 #define CYTHON_USE_UNICODE_WRITER 0
163 #elif !defined(CYTHON_USE_UNICODE_WRITER)
164 #define CYTHON_USE_UNICODE_WRITER 1
166 #ifndef CYTHON_AVOID_BORROWED_REFS
167 #define CYTHON_AVOID_BORROWED_REFS 0
169 #ifndef CYTHON_ASSUME_SAFE_MACROS
170 #define CYTHON_ASSUME_SAFE_MACROS 1
172 #ifndef CYTHON_UNPACK_METHODS
173 #define CYTHON_UNPACK_METHODS 1
175 #ifndef CYTHON_FAST_THREAD_STATE
176 #define CYTHON_FAST_THREAD_STATE 1
178 #ifndef CYTHON_FAST_PYCALL
179 #define CYTHON_FAST_PYCALL 1
181 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
182 #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
184 #ifndef CYTHON_USE_TP_FINALIZE
185 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
187 #ifndef CYTHON_USE_DICT_VERSIONS
188 #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
190 #ifndef CYTHON_USE_EXC_INFO_STACK
191 #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
194 #if !defined(CYTHON_FAST_PYCCALL)
195 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
197 #if CYTHON_USE_PYLONG_INTERNALS
198 #include "longintrepr.h"
203 enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P ==
sizeof(
void*)) };
206 #ifndef __has_attribute
207 #define __has_attribute(x) 0
209 #ifndef __has_cpp_attribute
210 #define __has_cpp_attribute(x) 0
212 #ifndef CYTHON_RESTRICT
213 #if defined(__GNUC__)
214 #define CYTHON_RESTRICT __restrict__
215 #elif defined(_MSC_VER) && _MSC_VER >= 1400
216 #define CYTHON_RESTRICT __restrict
217 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
218 #define CYTHON_RESTRICT restrict
220 #define CYTHON_RESTRICT
223 #ifndef CYTHON_UNUSED
224 # if defined(__GNUC__)
225 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
226 # define CYTHON_UNUSED __attribute__ ((__unused__))
228 # define CYTHON_UNUSED
230 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
231 # define CYTHON_UNUSED __attribute__ ((__unused__))
233 # define CYTHON_UNUSED
236 #ifndef CYTHON_MAYBE_UNUSED_VAR
237 # if defined(__cplusplus)
238 template<
class T>
void CYTHON_MAYBE_UNUSED_VAR(
const T& ) { }
240 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
243 #ifndef CYTHON_NCP_UNUSED
244 # if CYTHON_COMPILING_IN_CPYTHON
245 # define CYTHON_NCP_UNUSED
247 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
250 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
252 #ifndef _MSC_STDINT_H_
254 typedef unsigned char uint8_t;
255 typedef unsigned int uint32_t;
257 typedef unsigned __int8 uint8_t;
258 typedef unsigned __int32 uint32_t;
264 #ifndef CYTHON_FALLTHROUGH
265 #if defined(__cplusplus) && __cplusplus >= 201103L
266 #if __has_cpp_attribute(fallthrough)
267 #define CYTHON_FALLTHROUGH [[fallthrough]]
268 #elif __has_cpp_attribute(clang::fallthrough)
269 #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
270 #elif __has_cpp_attribute(gnu::fallthrough)
271 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
274 #ifndef CYTHON_FALLTHROUGH
275 #if __has_attribute(fallthrough)
276 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
278 #define CYTHON_FALLTHROUGH
281 #if defined(__clang__ ) && defined(__apple_build_version__)
282 #if __apple_build_version__ < 7000000
283 #undef CYTHON_FALLTHROUGH
284 #define CYTHON_FALLTHROUGH
290 #error "Cython files generated with the C++ option must be compiled with a C++ compiler."
292 #ifndef CYTHON_INLINE
293 #if defined(__clang__)
294 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
296 #define CYTHON_INLINE inline
300 void __Pyx_call_destructor(
T& x) {
304 class __Pyx_FakeReference {
306 __Pyx_FakeReference() : ptr(NULL) { }
307 __Pyx_FakeReference(
const T& ref) : ptr(const_cast<
T*>(&ref)) { }
308 T *operator->() {
return ptr; }
309 T *operator&() {
return ptr; }
310 operator T&() {
return *ptr; }
311 template<
typename U>
bool operator ==(
U other) {
return *ptr == other; }
312 template<
typename U>
bool operator !=(
U other) {
return *ptr != other; }
317 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
318 #define Py_OptimizeFlag 0
320 #define __PYX_BUILD_PY_SSIZE_T "n"
321 #define CYTHON_FORMAT_SSIZE_T "z"
322 #if PY_MAJOR_VERSION < 3
323 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
324 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
325 PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
326 #define __Pyx_DefaultClassType PyClass_Type
328 #define __Pyx_BUILTIN_MODULE_NAME "builtins"
329 #if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2
330 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
331 PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
333 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
334 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
336 #define __Pyx_DefaultClassType PyType_Type
338 #ifndef Py_TPFLAGS_CHECKTYPES
339 #define Py_TPFLAGS_CHECKTYPES 0
341 #ifndef Py_TPFLAGS_HAVE_INDEX
342 #define Py_TPFLAGS_HAVE_INDEX 0
344 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
345 #define Py_TPFLAGS_HAVE_NEWBUFFER 0
347 #ifndef Py_TPFLAGS_HAVE_FINALIZE
348 #define Py_TPFLAGS_HAVE_FINALIZE 0
350 #ifndef METH_STACKLESS
351 #define METH_STACKLESS 0
353 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
354 #ifndef METH_FASTCALL
355 #define METH_FASTCALL 0x80
357 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *
self, PyObject *
const *args, Py_ssize_t nargs);
358 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *
self, PyObject *
const *args,
359 Py_ssize_t nargs, PyObject *kwnames);
361 #define __Pyx_PyCFunctionFast _PyCFunctionFast
362 #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
364 #if CYTHON_FAST_PYCCALL
365 #define __Pyx_PyFastCFunction_Check(func)\
366 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
368 #define __Pyx_PyFastCFunction_Check(func) 0
370 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
371 #define PyObject_Malloc(s) PyMem_Malloc(s)
372 #define PyObject_Free(p) PyMem_Free(p)
373 #define PyObject_Realloc(p) PyMem_Realloc(p)
375 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
376 #define PyMem_RawMalloc(n) PyMem_Malloc(n)
377 #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n)
378 #define PyMem_RawFree(p) PyMem_Free(p)
380 #if CYTHON_COMPILING_IN_PYSTON
381 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
382 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
384 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
385 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
387 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
388 #define __Pyx_PyThreadState_Current PyThreadState_GET()
389 #elif PY_VERSION_HEX >= 0x03060000
390 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
391 #elif PY_VERSION_HEX >= 0x03000000
392 #define __Pyx_PyThreadState_Current PyThreadState_GET()
394 #define __Pyx_PyThreadState_Current _PyThreadState_Current
396 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
397 #include "pythread.h"
398 #define Py_tss_NEEDS_INIT 0
399 typedef int Py_tss_t;
400 static CYTHON_INLINE
int PyThread_tss_create(Py_tss_t *key) {
401 *key = PyThread_create_key();
404 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(
void) {
405 Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(
sizeof(Py_tss_t));
406 *key = Py_tss_NEEDS_INIT;
409 static CYTHON_INLINE
void PyThread_tss_free(Py_tss_t *key) {
412 static CYTHON_INLINE
int PyThread_tss_is_created(Py_tss_t *key) {
413 return *key != Py_tss_NEEDS_INIT;
415 static CYTHON_INLINE
void PyThread_tss_delete(Py_tss_t *key) {
416 PyThread_delete_key(*key);
417 *key = Py_tss_NEEDS_INIT;
419 static CYTHON_INLINE
int PyThread_tss_set(Py_tss_t *key,
void *value) {
420 return PyThread_set_key_value(*key, value);
422 static CYTHON_INLINE
void * PyThread_tss_get(Py_tss_t *key) {
423 return PyThread_get_key_value(*key);
426 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
427 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
429 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
431 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
432 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
433 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
435 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
436 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
438 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
439 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
441 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
443 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
444 #define CYTHON_PEP393_ENABLED 1
445 #if defined(PyUnicode_IS_READY)
446 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
447 0 : _PyUnicode_Ready((PyObject *)(op)))
449 #define __Pyx_PyUnicode_READY(op) (0)
451 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
452 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
453 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
454 #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
455 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
456 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
457 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
458 #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE)
459 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
460 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
462 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
465 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
468 #define CYTHON_PEP393_ENABLED 0
469 #define PyUnicode_1BYTE_KIND 1
470 #define PyUnicode_2BYTE_KIND 2
471 #define PyUnicode_4BYTE_KIND 4
472 #define __Pyx_PyUnicode_READY(op) (0)
473 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
474 #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
475 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
476 #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
477 #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
478 #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
479 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
480 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
482 #if CYTHON_COMPILING_IN_PYPY
483 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
484 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
486 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
487 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
488 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
490 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
491 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
493 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
494 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
496 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
497 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
499 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
500 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
501 #if PY_MAJOR_VERSION >= 3
502 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
504 #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
506 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
507 #define PyObject_ASCII(o) PyObject_Repr(o)
509 #if PY_MAJOR_VERSION >= 3
510 #define PyBaseString_Type PyUnicode_Type
511 #define PyStringObject PyUnicodeObject
512 #define PyString_Type PyUnicode_Type
513 #define PyString_Check PyUnicode_Check
514 #define PyString_CheckExact PyUnicode_CheckExact
515 #ifndef PyObject_Unicode
516 #define PyObject_Unicode PyObject_Str
519 #if PY_MAJOR_VERSION >= 3
520 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
521 #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
523 #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
524 #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
526 #ifndef PySet_CheckExact
527 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
529 #if PY_VERSION_HEX >= 0x030900A4
530 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
531 #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
533 #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
534 #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
536 #if CYTHON_ASSUME_SAFE_MACROS
537 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
539 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
541 #if PY_MAJOR_VERSION >= 3
542 #define PyIntObject PyLongObject
543 #define PyInt_Type PyLong_Type
544 #define PyInt_Check(op) PyLong_Check(op)
545 #define PyInt_CheckExact(op) PyLong_CheckExact(op)
546 #define PyInt_FromString PyLong_FromString
547 #define PyInt_FromUnicode PyLong_FromUnicode
548 #define PyInt_FromLong PyLong_FromLong
549 #define PyInt_FromSize_t PyLong_FromSize_t
550 #define PyInt_FromSsize_t PyLong_FromSsize_t
551 #define PyInt_AsLong PyLong_AsLong
552 #define PyInt_AS_LONG PyLong_AS_LONG
553 #define PyInt_AsSsize_t PyLong_AsSsize_t
554 #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
555 #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
556 #define PyNumber_Int PyNumber_Long
558 #if PY_MAJOR_VERSION >= 3
559 #define PyBoolObject PyLongObject
561 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
562 #ifndef PyUnicode_InternFromString
563 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
566 #if PY_VERSION_HEX < 0x030200A4
567 typedef long Py_hash_t;
568 #define __Pyx_PyInt_FromHash_t PyInt_FromLong
569 #define __Pyx_PyInt_AsHash_t PyInt_AsLong
571 #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
572 #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
574 #if PY_MAJOR_VERSION >= 3
575 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
577 #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
579 #if CYTHON_USE_ASYNC_SLOTS
580 #if PY_VERSION_HEX >= 0x030500B1
581 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
582 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
584 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
587 #define __Pyx_PyType_AsAsync(obj) NULL
589 #ifndef __Pyx_PyAsyncMethodsStruct
594 } __Pyx_PyAsyncMethodsStruct;
597 #if defined(WIN32) || defined(MS_WINDOWS)
598 #define _USE_MATH_DEFINES
602 #define __PYX_NAN() ((float) NAN)
604 static CYTHON_INLINE
float __PYX_NAN() {
606 memset(&value, 0xFF,
sizeof(value));
610 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
611 #define __Pyx_truncl trunc
613 #define __Pyx_truncl truncl
616 #define __PYX_MARK_ERR_POS(f_index, lineno) \
617 { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
618 #define __PYX_ERR(f_index, lineno, Ln_error) \
619 { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
621 #ifndef __PYX_EXTERN_C
623 #define __PYX_EXTERN_C extern "C"
625 #define __PYX_EXTERN_C extern
629 #define __PYX_HAVE__BoundaryConditions
630 #define __PYX_HAVE_API__BoundaryConditions
634 #include "numpy/arrayobject.h"
635 #include "numpy/ndarrayobject.h"
636 #include "numpy/ndarraytypes.h"
637 #include "numpy/arrayscalars.h"
638 #include "numpy/ufuncobject.h"
642 #include "pythread.h"
649 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
650 #define CYTHON_WITHOUT_ASSERTIONS
653 typedef struct {PyObject **p;
const char *
s;
const Py_ssize_t
n;
const char* encoding;
654 const char is_unicode;
const char is_str;
const char intern; } __Pyx_StringTabEntry;
656 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
657 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
658 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
659 #define __PYX_DEFAULT_STRING_ENCODING ""
660 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
661 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
662 #define __Pyx_uchar_cast(c) ((unsigned char)c)
663 #define __Pyx_long_cast(x) ((long)x)
664 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
665 (sizeof(type) < sizeof(Py_ssize_t)) ||\
666 (sizeof(type) > sizeof(Py_ssize_t) &&\
667 likely(v < (type)PY_SSIZE_T_MAX ||\
668 v == (type)PY_SSIZE_T_MAX) &&\
669 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
670 v == (type)PY_SSIZE_T_MIN))) ||\
671 (sizeof(type) == sizeof(Py_ssize_t) &&\
672 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
673 v == (type)PY_SSIZE_T_MAX))) )
674 static CYTHON_INLINE
int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
675 return (
size_t) i < (size_t) limit;
677 #if defined (__cplusplus) && __cplusplus >= 201103L
679 #define __Pyx_sst_abs(value) std::abs(value)
680 #elif SIZEOF_INT >= SIZEOF_SIZE_T
681 #define __Pyx_sst_abs(value) abs(value)
682 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
683 #define __Pyx_sst_abs(value) labs(value)
684 #elif defined (_MSC_VER)
685 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
686 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
687 #define __Pyx_sst_abs(value) llabs(value)
688 #elif defined (__GNUC__)
689 #define __Pyx_sst_abs(value) __builtin_llabs(value)
691 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
693 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject*);
694 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
695 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
696 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
697 #define __Pyx_PyBytes_FromString PyBytes_FromString
698 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
699 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char*);
700 #if PY_MAJOR_VERSION < 3
701 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
702 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
704 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
705 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
707 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
708 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
709 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
710 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
711 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
712 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
713 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
714 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
715 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
716 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
717 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
718 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
719 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
720 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
721 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
722 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
723 static CYTHON_INLINE
size_t __Pyx_Py_UNICODE_strlen(
const Py_UNICODE *
u) {
724 const Py_UNICODE *u_end =
u;
726 return (
size_t)(u_end -
u - 1);
728 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
729 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
730 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
731 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
732 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
733 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b);
734 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject*);
735 static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
736 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
737 #define __Pyx_PySequence_Tuple(obj)\
738 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
739 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
740 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t);
741 #if CYTHON_ASSUME_SAFE_MACROS
742 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
744 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
746 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
747 #if PY_MAJOR_VERSION >= 3
748 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
750 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
752 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
753 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
754 static int __Pyx_sys_getdefaultencoding_not_ascii;
755 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
757 PyObject* default_encoding = NULL;
758 PyObject* ascii_chars_u = NULL;
759 PyObject* ascii_chars_b = NULL;
760 const char* default_encoding_c;
761 sys = PyImport_ImportModule(
"sys");
763 default_encoding = PyObject_CallMethod(sys, (
char*)
"getdefaultencoding", NULL);
765 if (!default_encoding)
goto bad;
766 default_encoding_c = PyBytes_AsString(default_encoding);
767 if (!default_encoding_c)
goto bad;
768 if (strcmp(default_encoding_c,
"ascii") == 0) {
769 __Pyx_sys_getdefaultencoding_not_ascii = 0;
771 char ascii_chars[128];
773 for (
c = 0;
c < 128;
c++) {
776 __Pyx_sys_getdefaultencoding_not_ascii = 1;
777 ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
778 if (!ascii_chars_u)
goto bad;
779 ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
780 if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
783 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
787 Py_DECREF(ascii_chars_u);
788 Py_DECREF(ascii_chars_b);
790 Py_DECREF(default_encoding);
793 Py_XDECREF(default_encoding);
794 Py_XDECREF(ascii_chars_u);
795 Py_XDECREF(ascii_chars_b);
799 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
800 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
802 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
803 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
804 static char* __PYX_DEFAULT_STRING_ENCODING;
805 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
807 PyObject* default_encoding = NULL;
808 char* default_encoding_c;
809 sys = PyImport_ImportModule(
"sys");
811 default_encoding = PyObject_CallMethod(sys, (
char*) (
const char*)
"getdefaultencoding", NULL);
813 if (!default_encoding)
goto bad;
814 default_encoding_c = PyBytes_AsString(default_encoding);
815 if (!default_encoding_c)
goto bad;
816 __PYX_DEFAULT_STRING_ENCODING = (
char*) malloc(strlen(default_encoding_c) + 1);
817 if (!__PYX_DEFAULT_STRING_ENCODING)
goto bad;
818 strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
819 Py_DECREF(default_encoding);
822 Py_XDECREF(default_encoding);
830 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
831 #define likely(x) __builtin_expect(!!(x), 1)
832 #define unlikely(x) __builtin_expect(!!(x), 0)
834 #define likely(x) (x)
835 #define unlikely(x) (x)
837 static CYTHON_INLINE
void __Pyx_pretend_to_initialize(
void* ptr) { (void)ptr; }
839 static PyObject *__pyx_m = NULL;
840 static PyObject *__pyx_d;
841 static PyObject *__pyx_b;
842 static PyObject *__pyx_cython_runtime = NULL;
843 static PyObject *__pyx_empty_tuple;
844 static PyObject *__pyx_empty_bytes;
845 static PyObject *__pyx_empty_unicode;
846 static int __pyx_lineno;
847 static int __pyx_clineno = 0;
848 static const char * __pyx_cfilenm= __FILE__;
849 static const char *__pyx_filename;
852 #if !defined(CYTHON_CCOMPLEX)
853 #if defined(__cplusplus)
854 #define CYTHON_CCOMPLEX 1
855 #elif defined(_Complex_I)
856 #define CYTHON_CCOMPLEX 1
858 #define CYTHON_CCOMPLEX 0
868 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
870 #define _Complex_I 1.0fj
874 static const char *__pyx_f[] = {
875 "proteus/BoundaryConditions.py",
877 "proteus/BoundaryConditions.pxd",
882 struct __pyx_memoryview_obj;
884 struct __pyx_memoryview_obj *memview;
887 Py_ssize_t strides[8];
888 Py_ssize_t suboffsets[8];
889 } __Pyx_memviewslice;
890 #define __Pyx_MemoryView_Len(m) (m.shape[0])
893 #include <pythread.h>
894 #ifndef CYTHON_ATOMICS
895 #define CYTHON_ATOMICS 1
897 #define __pyx_atomic_int_type int
898 #if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 ||\
899 (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) &&\
901 #define __pyx_atomic_incr_aligned(value, lock) __sync_fetch_and_add(value, 1)
902 #define __pyx_atomic_decr_aligned(value, lock) __sync_fetch_and_sub(value, 1)
903 #ifdef __PYX_DEBUG_ATOMICS
904 #warning "Using GNU atomics"
906 #elif CYTHON_ATOMICS && defined(_MSC_VER) && 0
908 #undef __pyx_atomic_int_type
909 #define __pyx_atomic_int_type LONG
910 #define __pyx_atomic_incr_aligned(value, lock) InterlockedIncrement(value)
911 #define __pyx_atomic_decr_aligned(value, lock) InterlockedDecrement(value)
912 #ifdef __PYX_DEBUG_ATOMICS
913 #pragma message ("Using MSVC atomics")
915 #elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0
916 #define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value)
917 #define __pyx_atomic_decr_aligned(value, lock) _InterlockedDecrement(value)
918 #ifdef __PYX_DEBUG_ATOMICS
919 #warning "Using Intel atomics"
922 #undef CYTHON_ATOMICS
923 #define CYTHON_ATOMICS 0
924 #ifdef __PYX_DEBUG_ATOMICS
925 #warning "Not using atomics"
928 typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
930 #define __pyx_add_acquisition_count(memview)\
931 __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
932 #define __pyx_sub_acquisition_count(memview)\
933 __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
935 #define __pyx_add_acquisition_count(memview)\
936 __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
937 #define __pyx_sub_acquisition_count(memview)\
938 __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
942 #ifndef __PYX_FORCE_INIT_THREADS
943 #define __PYX_FORCE_INIT_THREADS 0
947 #define __Pyx_PyGILState_Ensure PyGILState_Ensure
948 #define __Pyx_PyGILState_Release PyGILState_Release
949 #define __Pyx_FastGIL_Remember()
950 #define __Pyx_FastGIL_Forget()
951 #define __Pyx_FastGilFuncInit()
954 #define IS_UNSIGNED(type) (((type) -1) > 0)
955 struct __Pyx_StructField_;
956 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
959 struct __Pyx_StructField_* fields;
967 typedef struct __Pyx_StructField_ {
968 __Pyx_TypeInfo* type;
973 __Pyx_StructField* field;
974 size_t parent_offset;
975 } __Pyx_BufFmt_StackElem;
977 __Pyx_StructField root;
978 __Pyx_BufFmt_StackElem* head;
980 size_t new_count, enc_count;
981 size_t struct_alignment;
987 } __Pyx_BufFmt_Context;
997 typedef npy_int8 __pyx_t_5numpy_int8_t;
1006 typedef npy_int16 __pyx_t_5numpy_int16_t;
1015 typedef npy_int32 __pyx_t_5numpy_int32_t;
1024 typedef npy_int64 __pyx_t_5numpy_int64_t;
1033 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1042 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1051 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1060 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1069 typedef npy_float32 __pyx_t_5numpy_float32_t;
1078 typedef npy_float64 __pyx_t_5numpy_float64_t;
1087 typedef npy_long __pyx_t_5numpy_int_t;
1096 typedef npy_longlong __pyx_t_5numpy_long_t;
1105 typedef npy_longlong __pyx_t_5numpy_longlong_t;
1114 typedef npy_ulong __pyx_t_5numpy_uint_t;
1123 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
1132 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1141 typedef npy_intp __pyx_t_5numpy_intp_t;
1150 typedef npy_uintp __pyx_t_5numpy_uintp_t;
1159 typedef npy_double __pyx_t_5numpy_float_t;
1168 typedef npy_double __pyx_t_5numpy_double_t;
1177 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1181 typedef ::std::complex< float > __pyx_t_float_complex;
1183 typedef float _Complex __pyx_t_float_complex;
1186 typedef struct {
float real, imag; } __pyx_t_float_complex;
1188 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float,
float);
1193 typedef ::std::complex< double > __pyx_t_double_complex;
1195 typedef double _Complex __pyx_t_double_complex;
1198 typedef struct {
double real, imag; } __pyx_t_double_complex;
1200 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double,
double);
1204 struct __pyx_obj_18BoundaryConditions_BC_Base;
1205 struct __pyx_obj_18BoundaryConditions_BoundaryCondition;
1206 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC;
1207 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC;
1208 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp;
1209 struct __pyx_array_obj;
1210 struct __pyx_MemviewEnum_obj;
1211 struct __pyx_memoryview_obj;
1212 struct __pyx_memoryviewslice_obj;
1221 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1230 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
1239 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
1248 typedef npy_cdouble __pyx_t_5numpy_complex_t;
1249 struct __pyx_defaults;
1250 typedef struct __pyx_defaults __pyx_defaults;
1251 struct __pyx_defaults1;
1252 typedef struct __pyx_defaults1 __pyx_defaults1;
1253 struct __pyx_defaults2;
1254 typedef struct __pyx_defaults2 __pyx_defaults2;
1263 typedef double (*__pyx_t_18BoundaryConditions_cpp_uOfXT)(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *, __Pyx_memviewslice, double);
1264 struct __pyx_defaults {
1265 PyObject *__pyx_arg_n;
1267 struct __pyx_defaults1 {
1268 PyObject *__pyx_arg_n;
1270 struct __pyx_defaults2 {
1271 PyObject *__pyx_arg_n;
1281 struct __pyx_obj_18BoundaryConditions_BC_Base {
1283 __Pyx_memviewslice _b_or;
1299 struct __pyx_obj_18BoundaryConditions_BoundaryCondition {
1301 struct __pyx_vtabstruct_18BoundaryConditions_BoundaryCondition *__pyx_vtab;
1302 __pyx_t_18BoundaryConditions_cpp_uOfXT uuOfXT;
1314 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC {
1316 PyObject *__pyx_v_value;
1327 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC {
1329 PyObject *__pyx_v_a;
1330 PyObject *__pyx_v_a0;
1341 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp {
1343 PyObject *__pyx_v_t1;
1344 PyObject *__pyx_v_value;
1355 struct __pyx_array_obj {
1357 struct __pyx_vtabstruct_array *__pyx_vtab;
1363 Py_ssize_t *_strides;
1364 Py_ssize_t itemsize;
1367 void (*callback_free_data)(
void *);
1369 int dtype_is_object;
1380 struct __pyx_MemviewEnum_obj {
1393 struct __pyx_memoryview_obj {
1395 struct __pyx_vtabstruct_memoryview *__pyx_vtab;
1398 PyObject *_array_interface;
1399 PyThread_type_lock lock;
1400 __pyx_atomic_int acquisition_count[2];
1401 __pyx_atomic_int *acquisition_count_aligned_p;
1404 int dtype_is_object;
1405 __Pyx_TypeInfo *typeinfo;
1416 struct __pyx_memoryviewslice_obj {
1417 struct __pyx_memoryview_obj __pyx_base;
1418 __Pyx_memviewslice from_slice;
1419 PyObject *from_object;
1420 PyObject *(*to_object_func)(
char *);
1421 int (*to_dtype_func)(
char *, PyObject *);
1434 struct __pyx_vtabstruct_18BoundaryConditions_BoundaryCondition {
1435 void (*resetBC)(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *,
int __pyx_skip_dispatch);
1437 static struct __pyx_vtabstruct_18BoundaryConditions_BoundaryCondition *__pyx_vtabptr_18BoundaryConditions_BoundaryCondition;
1448 struct __pyx_vtabstruct_array {
1449 PyObject *(*get_memview)(
struct __pyx_array_obj *);
1451 static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
1462 struct __pyx_vtabstruct_memoryview {
1463 char *(*get_item_pointer)(
struct __pyx_memoryview_obj *, PyObject *);
1464 PyObject *(*is_slice)(
struct __pyx_memoryview_obj *, PyObject *);
1465 PyObject *(*setitem_slice_assignment)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1466 PyObject *(*setitem_slice_assign_scalar)(
struct __pyx_memoryview_obj *,
struct __pyx_memoryview_obj *, PyObject *);
1467 PyObject *(*setitem_indexed)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1468 PyObject *(*convert_item_to_object)(
struct __pyx_memoryview_obj *,
char *);
1469 PyObject *(*assign_item_from_object)(
struct __pyx_memoryview_obj *,
char *, PyObject *);
1471 static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
1482 struct __pyx_vtabstruct__memoryviewslice {
1483 struct __pyx_vtabstruct_memoryview __pyx_base;
1485 static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
1489 #ifndef CYTHON_REFNANNY
1490 #define CYTHON_REFNANNY 0
1494 void (*INCREF)(
void*, PyObject*, int);
1495 void (*DECREF)(
void*, PyObject*, int);
1496 void (*GOTREF)(
void*, PyObject*, int);
1497 void (*GIVEREF)(
void*, PyObject*, int);
1498 void* (*SetupContext)(
const char*, int,
const char*);
1499 void (*FinishContext)(
void**);
1500 } __Pyx_RefNannyAPIStruct;
1501 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1502 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname);
1503 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1505 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1507 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1508 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1509 PyGILState_Release(__pyx_gilstate_save);\
1511 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1514 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1515 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1517 #define __Pyx_RefNannyFinishContext()\
1518 __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1519 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1520 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1521 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1522 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1523 #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1524 #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1525 #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1526 #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1528 #define __Pyx_RefNannyDeclarations
1529 #define __Pyx_RefNannySetupContext(name, acquire_gil)
1530 #define __Pyx_RefNannyFinishContext()
1531 #define __Pyx_INCREF(r) Py_INCREF(r)
1532 #define __Pyx_DECREF(r) Py_DECREF(r)
1533 #define __Pyx_GOTREF(r)
1534 #define __Pyx_GIVEREF(r)
1535 #define __Pyx_XINCREF(r) Py_XINCREF(r)
1536 #define __Pyx_XDECREF(r) Py_XDECREF(r)
1537 #define __Pyx_XGOTREF(r)
1538 #define __Pyx_XGIVEREF(r)
1540 #define __Pyx_XDECREF_SET(r, v) do {\
1541 PyObject *tmp = (PyObject *) r;\
1542 r = v; __Pyx_XDECREF(tmp);\
1544 #define __Pyx_DECREF_SET(r, v) do {\
1545 PyObject *tmp = (PyObject *) r;\
1546 r = v; __Pyx_DECREF(tmp);\
1548 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1549 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1552 #if CYTHON_USE_TYPE_SLOTS
1553 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1555 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1559 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1562 static void __Pyx_RaiseDoubleKeywordsError(
const char* func_name, PyObject* kw_name);
1565 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1566 PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1567 const char* function_name);
1570 static void __Pyx_RaiseArgtupleInvalid(
const char* func_name,
int exact,
1571 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1574 #if CYTHON_FAST_THREAD_STATE
1575 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1576 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1577 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
1579 #define __Pyx_PyThreadState_declare
1580 #define __Pyx_PyThreadState_assign
1581 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1585 #if CYTHON_FAST_THREAD_STATE
1586 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1587 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1588 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1589 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1590 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1591 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1592 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1593 #if CYTHON_COMPILING_IN_CPYTHON
1594 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1596 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1599 #define __Pyx_PyErr_Clear() PyErr_Clear()
1600 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1601 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1602 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1603 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1604 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1605 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1606 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1610 #ifndef CYTHON_PROFILE
1611 #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
1612 #define CYTHON_PROFILE 0
1614 #define CYTHON_PROFILE 1
1617 #ifndef CYTHON_TRACE_NOGIL
1618 #define CYTHON_TRACE_NOGIL 0
1620 #if CYTHON_TRACE_NOGIL && !defined(CYTHON_TRACE)
1621 #define CYTHON_TRACE 1
1624 #ifndef CYTHON_TRACE
1625 #define CYTHON_TRACE 0
1628 #undef CYTHON_PROFILE_REUSE_FRAME
1630 #ifndef CYTHON_PROFILE_REUSE_FRAME
1631 #define CYTHON_PROFILE_REUSE_FRAME 0
1633 #if CYTHON_PROFILE || CYTHON_TRACE
1634 #include "compile.h"
1635 #include "frameobject.h"
1636 #include "traceback.h"
1637 #if CYTHON_PROFILE_REUSE_FRAME
1638 #define CYTHON_FRAME_MODIFIER static
1639 #define CYTHON_FRAME_DEL(frame)
1641 #define CYTHON_FRAME_MODIFIER
1642 #define CYTHON_FRAME_DEL(frame) Py_CLEAR(frame)
1644 #define __Pyx_TraceDeclarations\
1645 static PyCodeObject *__pyx_frame_code = NULL;\
1646 CYTHON_FRAME_MODIFIER PyFrameObject *__pyx_frame = NULL;\
1647 int __Pyx_use_tracing = 0;
1648 #define __Pyx_TraceFrameInit(codeobj)\
1649 if (codeobj) __pyx_frame_code = (PyCodeObject*) codeobj;
1650 #if PY_VERSION_HEX >= 0x030a00b1
1651 #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\
1652 (unlikely((tstate)->cframe->use_tracing) &&\
1653 (!(check_tracing) || !(tstate)->tracing) &&\
1654 (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc)))
1655 #define __Pyx_SetTracing(tstate, enable)\
1656 (tstate)->cframe->use_tracing = (enable)
1658 #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\
1659 (unlikely((tstate)->use_tracing) &&\
1660 (!(check_tracing) || !(tstate)->tracing) &&\
1661 (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc)))
1662 #define __Pyx_SetTracing(tstate, enable)\
1663 (tstate)->use_tracing = (enable)
1666 #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\
1668 if (CYTHON_TRACE_NOGIL) {\
1669 PyThreadState *tstate;\
1670 PyGILState_STATE state = PyGILState_Ensure();\
1671 tstate = __Pyx_PyThreadState_Current;\
1672 if (__Pyx_IsTracing(tstate, 1, 1)) {\
1673 __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
1675 PyGILState_Release(state);\
1676 if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
1679 PyThreadState* tstate = PyThreadState_GET();\
1680 if (__Pyx_IsTracing(tstate, 1, 1)) {\
1681 __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
1682 if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
1686 #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\
1687 { PyThreadState* tstate = PyThreadState_GET();\
1688 if (__Pyx_IsTracing(tstate, 1, 1)) {\
1689 __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
1690 if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
1694 #define __Pyx_TraceException()\
1695 if (likely(!__Pyx_use_tracing)); else {\
1696 PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1697 if (__Pyx_IsTracing(tstate, 0, 1)) {\
1699 __Pyx_SetTracing(tstate, 0);\
1700 PyObject *exc_info = __Pyx_GetExceptionTuple(tstate);\
1702 if (CYTHON_TRACE && tstate->c_tracefunc)\
1703 tstate->c_tracefunc(\
1704 tstate->c_traceobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\
1705 tstate->c_profilefunc(\
1706 tstate->c_profileobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\
1707 Py_DECREF(exc_info);\
1709 __Pyx_SetTracing(tstate, 1);\
1713 static void __Pyx_call_return_trace_func(PyThreadState *tstate, PyFrameObject *frame, PyObject *result) {
1714 PyObject *type, *value, *traceback;
1715 __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
1717 __Pyx_SetTracing(tstate, 0);
1718 if (CYTHON_TRACE && tstate->c_tracefunc)
1719 tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_RETURN, result);
1720 if (tstate->c_profilefunc)
1721 tstate->c_profilefunc(tstate->c_profileobj, frame, PyTrace_RETURN, result);
1722 CYTHON_FRAME_DEL(frame);
1723 __Pyx_SetTracing(tstate, 1);
1725 __Pyx_ErrRestoreInState(tstate, type, value, traceback);
1728 #define __Pyx_TraceReturn(result, nogil)\
1729 if (likely(!__Pyx_use_tracing)); else {\
1731 if (CYTHON_TRACE_NOGIL) {\
1732 PyThreadState *tstate;\
1733 PyGILState_STATE state = PyGILState_Ensure();\
1734 tstate = __Pyx_PyThreadState_Current;\
1735 if (__Pyx_IsTracing(tstate, 0, 0)) {\
1736 __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
1738 PyGILState_Release(state);\
1741 PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1742 if (__Pyx_IsTracing(tstate, 0, 0)) {\
1743 __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
1748 #define __Pyx_TraceReturn(result, nogil)\
1749 if (likely(!__Pyx_use_tracing)); else {\
1750 PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1751 if (__Pyx_IsTracing(tstate, 0, 0)) {\
1752 __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
1756 static PyCodeObject *__Pyx_createFrameCodeObject(
const char *funcname,
const char *srcfile,
int firstlineno);
1757 static int __Pyx_TraceSetupAndCall(PyCodeObject** code, PyFrameObject** frame, PyThreadState* tstate,
const char *funcname,
const char *srcfile,
int firstlineno);
1759 #define __Pyx_TraceDeclarations
1760 #define __Pyx_TraceFrameInit(codeobj)
1761 #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error) if ((1)); else goto_error;
1762 #define __Pyx_TraceException()
1763 #define __Pyx_TraceReturn(result, nogil)
1766 static int __Pyx_call_line_trace_func(PyThreadState *tstate, PyFrameObject *frame,
int lineno) {
1768 PyObject *type, *value, *traceback;
1769 __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
1770 __Pyx_PyFrame_SetLineNumber(frame, lineno);
1772 __Pyx_SetTracing(tstate, 0);
1773 ret = tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_LINE, NULL);
1774 __Pyx_SetTracing(tstate, 1);
1777 __Pyx_ErrRestoreInState(tstate, type, value, traceback);
1781 Py_XDECREF(traceback);
1786 #define __Pyx_TraceLine(lineno, nogil, goto_error)\
1787 if (likely(!__Pyx_use_tracing)); else {\
1789 if (CYTHON_TRACE_NOGIL) {\
1791 PyThreadState *tstate;\
1792 PyGILState_STATE state = PyGILState_Ensure();\
1793 tstate = __Pyx_PyThreadState_Current;\
1794 if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\
1795 ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
1797 PyGILState_Release(state);\
1798 if (unlikely(ret)) goto_error;\
1801 PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1802 if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\
1803 int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
1804 if (unlikely(ret)) goto_error;\
1809 #define __Pyx_TraceLine(lineno, nogil, goto_error)\
1810 if (likely(!__Pyx_use_tracing)); else {\
1811 PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1812 if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\
1813 int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
1814 if (unlikely(ret)) goto_error;\
1819 #define __Pyx_TraceLine(lineno, nogil, goto_error) if ((1)); else goto_error;
1823 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1824 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1825 __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
1826 (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
1827 __Pyx_GetItemInt_Generic(o, to_py_func(i))))
1828 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1829 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1830 __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1831 (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1832 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
1833 int wraparound,
int boundscheck);
1834 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1835 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1836 __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1837 (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
1838 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
1839 int wraparound,
int boundscheck);
1840 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1841 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
1842 int is_list,
int wraparound,
int boundscheck);
1845 #if CYTHON_USE_TYPE_SLOTS
1846 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
1848 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
1852 #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
1853 #define __Pyx_MEMVIEW_DIRECT 1
1854 #define __Pyx_MEMVIEW_PTR 2
1855 #define __Pyx_MEMVIEW_FULL 4
1856 #define __Pyx_MEMVIEW_CONTIG 8
1857 #define __Pyx_MEMVIEW_STRIDED 16
1858 #define __Pyx_MEMVIEW_FOLLOW 32
1859 #define __Pyx_IS_C_CONTIG 1
1860 #define __Pyx_IS_F_CONTIG 2
1861 static int __Pyx_init_memviewslice(
1862 struct __pyx_memoryview_obj *memview,
1864 __Pyx_memviewslice *memviewslice,
1865 int memview_is_new_reference);
1866 static CYTHON_INLINE
int __pyx_add_acquisition_count_locked(
1867 __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1868 static CYTHON_INLINE
int __pyx_sub_acquisition_count_locked(
1869 __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1870 #define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p)
1871 #define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview))
1872 #define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
1873 #define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__)
1874 static CYTHON_INLINE
void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *,
int,
int);
1875 static CYTHON_INLINE
void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *,
int,
int);
1878 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level);
1881 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
1884 #if CYTHON_FAST_PYCALL
1885 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1886 __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1887 #if 1 || PY_VERSION_HEX < 0x030600B1
1888 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
1890 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1892 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
1893 (sizeof(char [1 - 2*!(cond)]) - 1)
1894 #ifndef Py_MEMBER_SIZE
1895 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
1897 static size_t __pyx_pyframe_localsplus_offset = 0;
1898 #include "frameobject.h"
1899 #define __Pxy_PyFrame_Initialize_Offsets()\
1900 ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
1901 (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
1902 #define __Pyx_PyFrame_GetLocalsplus(frame)\
1903 (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
1907 #if CYTHON_COMPILING_IN_CPYTHON
1908 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1910 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1914 #if CYTHON_COMPILING_IN_CPYTHON
1915 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1919 #if CYTHON_COMPILING_IN_CPYTHON
1920 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
1922 #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
1926 #if CYTHON_FAST_PYCCALL
1927 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1929 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
1933 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1936 #if CYTHON_FAST_THREAD_STATE
1937 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1938 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1940 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
1944 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
1947 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
1950 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1951 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
1952 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
1953 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1954 (version_var) = __PYX_GET_DICT_VERSION(dict);\
1955 (cache_var) = (value);
1956 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1957 static PY_UINT64_T __pyx_dict_version = 0;\
1958 static PyObject *__pyx_dict_cached_value = NULL;\
1959 if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1960 (VAR) = __pyx_dict_cached_value;\
1962 (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1963 __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1966 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1967 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1968 static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1970 #define __PYX_GET_DICT_VERSION(dict) (0)
1971 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1972 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
1976 #if CYTHON_USE_DICT_VERSIONS
1977 #define __Pyx_GetModuleGlobalName(var, name) {\
1978 static PY_UINT64_T __pyx_dict_version = 0;\
1979 static PyObject *__pyx_dict_cached_value = NULL;\
1980 (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
1981 (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
1982 __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1984 #define __Pyx_GetModuleGlobalNameUncached(var, name) {\
1985 PY_UINT64_T __pyx_dict_version;\
1986 PyObject *__pyx_dict_cached_value;\
1987 (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1989 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1991 #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1992 #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1993 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1997 static int __Pyx_CheckKeywordStrings(PyObject *kwdict,
const char* function_name,
int kw_allowed);
2000 static void __Pyx_WriteUnraisable(
const char *name,
int clineno,
2001 int lineno,
const char *filename,
2002 int full_traceback,
int nogil);
2005 static CYTHON_INLINE
void __Pyx_RaiseClosureNameError(
const char *varname);
2008 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
2011 #define __Pyx_CyFunction_USED 1
2012 #define __Pyx_CYFUNCTION_STATICMETHOD 0x01
2013 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
2014 #define __Pyx_CYFUNCTION_CCLASS 0x04
2015 #define __Pyx_CyFunction_GetClosure(f)\
2016 (((__pyx_CyFunctionObject *) (f))->func_closure)
2017 #define __Pyx_CyFunction_GetClassObj(f)\
2018 (((__pyx_CyFunctionObject *) (f))->func_classobj)
2019 #define __Pyx_CyFunction_Defaults(type, f)\
2020 ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
2021 #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
2022 ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
2024 PyCFunctionObject func;
2025 #if PY_VERSION_HEX < 0x030500A0
2026 PyObject *func_weakreflist;
2028 PyObject *func_dict;
2029 PyObject *func_name;
2030 PyObject *func_qualname;
2032 PyObject *func_globals;
2033 PyObject *func_code;
2034 PyObject *func_closure;
2035 PyObject *func_classobj;
2037 int defaults_pyobjects;
2038 size_t defaults_size;
2040 PyObject *defaults_tuple;
2041 PyObject *defaults_kwdict;
2042 PyObject *(*defaults_getter)(PyObject *);
2043 PyObject *func_annotations;
2044 } __pyx_CyFunctionObject;
2045 static PyTypeObject *__pyx_CyFunctionType = 0;
2046 #define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType))
2047 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml,
2048 int flags, PyObject* qualname,
2050 PyObject *module, PyObject *globals,
2052 static CYTHON_INLINE
void *__Pyx_CyFunction_InitDefaults(PyObject *m,
2055 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
2057 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
2059 static CYTHON_INLINE
void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
2061 static int __pyx_CyFunction_init(
void);
2064 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
2065 int flags, PyObject* qualname,
2067 PyObject *module, PyObject *globals,
2071 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject*
function, PyObject* arg1, PyObject* arg2);
2074 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(
2075 PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop,
2076 PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
2077 int has_cstart,
int has_cstop,
int wraparound);
2080 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
2083 static CYTHON_INLINE
int __Pyx_HasAttr(PyObject *, PyObject *);
2086 #if CYTHON_USE_EXC_INFO_STACK
2087 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
2091 #if CYTHON_FAST_THREAD_STATE
2092 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
2093 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2094 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
2095 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
2097 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
2098 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
2102 #if CYTHON_FAST_THREAD_STATE
2103 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
2104 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2106 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
2110 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
2111 ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
2112 __Pyx__ArgTypeTest(obj, type, name, exact))
2113 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type,
const char *name,
int exact);
2119 static CYTHON_INLINE
int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2,
int equals);
2122 static CYTHON_INLINE
int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2,
int equals);
2125 #if PY_MAJOR_VERSION >= 3
2126 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
2128 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
2132 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t);
2135 #define UNARY_NEG_WOULD_OVERFLOW(x)\
2136 (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
2138 static CYTHON_UNUSED
int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
2139 static PyObject *__pyx_array_get_memview(
struct __pyx_array_obj *);
2141 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(
const char *
s, Py_ssize_t size,
const char *errors) {
2143 return PyUnicode_DecodeUTF16(
s, size, errors, &byteorder);
2145 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(
const char *
s, Py_ssize_t size,
const char *errors) {
2147 return PyUnicode_DecodeUTF16(
s, size, errors, &byteorder);
2149 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(
const char *
s, Py_ssize_t size,
const char *errors) {
2151 return PyUnicode_DecodeUTF16(
s, size, errors, &byteorder);
2155 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
2156 const char* cstring, Py_ssize_t start, Py_ssize_t stop,
2157 const char* encoding,
const char* errors,
2158 PyObject* (*decode_func)(
const char *
s, Py_ssize_t size,
const char *errors));
2161 static CYTHON_INLINE
void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
2164 static CYTHON_INLINE
void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
2167 static CYTHON_INLINE
void __Pyx_RaiseNoneNotIterableError(
void);
2170 static CYTHON_INLINE
int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
2173 #if CYTHON_FAST_THREAD_STATE
2174 #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
2175 static CYTHON_INLINE
void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2177 static CYTHON_INLINE
void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
2181 #if CYTHON_COMPILING_IN_CPYTHON
2182 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
2183 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
2184 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
2185 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
2187 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
2188 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
2189 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
2191 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
2193 static CYTHON_UNUSED
int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
2195 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
2196 static CYTHON_INLINE
int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
2197 PyListObject*
L = (PyListObject*) list;
2198 Py_ssize_t len = Py_SIZE(list);
2199 if (likely(
L->allocated > len)) {
2201 PyList_SET_ITEM(list, len, x);
2202 __Pyx_SET_SIZE(list, len + 1);
2205 return PyList_Append(list, x);
2208 #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
2212 #if !CYTHON_COMPILING_IN_PYPY
2213 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2,
long intval,
int inplace,
int zerodivision_check);
2215 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
2216 (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
2220 static CYTHON_INLINE
int __Pyx_PyList_Extend(PyObject*
L, PyObject*
v) {
2221 #if CYTHON_COMPILING_IN_CPYTHON
2222 PyObject* none = _PyList_Extend((PyListObject*)
L,
v);
2223 if (unlikely(!none))
2228 return PyList_SetSlice(
L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX,
v);
2233 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
2234 static CYTHON_INLINE
int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
2235 PyListObject*
L = (PyListObject*) list;
2236 Py_ssize_t len = Py_SIZE(list);
2237 if (likely(
L->allocated > len) & likely(len > (
L->allocated >> 1))) {
2239 PyList_SET_ITEM(list, len, x);
2240 __Pyx_SET_SIZE(list, len + 1);
2243 return PyList_Append(list, x);
2246 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
2250 static CYTHON_INLINE
void __Pyx_RaiseUnboundLocalError(
const char *varname);
2253 static CYTHON_INLINE
long __Pyx_div_long(
long,
long);
2256 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2257 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
2259 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
2263 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2264 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
2266 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
2270 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
2273 static int __Pyx_setup_reduce(PyObject* type_obj);
2276 static int __Pyx_SetVtable(PyObject *dict,
void *vtable);
2279 #ifndef __PYX_HAVE_RT_ImportType_proto
2280 #define __PYX_HAVE_RT_ImportType_proto
2281 enum __Pyx_ImportType_CheckSize {
2282 __Pyx_ImportType_CheckSize_Error = 0,
2283 __Pyx_ImportType_CheckSize_Warn = 1,
2284 __Pyx_ImportType_CheckSize_Ignore = 2
2286 static PyTypeObject *__Pyx_ImportType(PyObject* module,
const char *module_name,
const char *class_name,
size_t size,
enum __Pyx_ImportType_CheckSize check_size);
2290 #ifdef CYTHON_CLINE_IN_TRACEBACK
2291 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
2293 static int __Pyx_CLineForTraceback(PyThreadState *tstate,
int c_line);
2298 PyCodeObject* code_object;
2300 } __Pyx_CodeObjectCacheEntry;
2301 struct __Pyx_CodeObjectCache {
2304 __Pyx_CodeObjectCacheEntry* entries;
2306 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
2307 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line);
2308 static PyCodeObject *__pyx_find_code_object(
int code_line);
2309 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object);
2312 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
2313 int py_line,
const char *filename);
2315 #if PY_MAJOR_VERSION < 3
2316 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view,
int flags);
2317 static void __Pyx_ReleaseBuffer(Py_buffer *view);
2319 #define __Pyx_GetBuffer PyObject_GetBuffer
2320 #define __Pyx_ReleaseBuffer PyBuffer_Release
2326 Py_ssize_t shape, strides, suboffsets;
2327 } __Pyx_Buf_DimInfo;
2333 __Pyx_Buffer *rcbuffer;
2335 __Pyx_Buf_DimInfo diminfo[8];
2336 } __Pyx_LocalBuf_ND;
2339 static int __pyx_memviewslice_is_contig(
const __Pyx_memviewslice mvs,
char order,
int ndim);
2342 static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
2343 __Pyx_memviewslice *slice2,
2344 int ndim,
size_t itemsize);
2347 static CYTHON_INLINE PyObject *__pyx_capsule_create(
void *p,
const char *sig);
2350 static CYTHON_INLINE PyObject *__pyx_memview_get_double(
const char *itemp);
2351 static CYTHON_INLINE
int __pyx_memview_set_double(
const char *itemp, PyObject *obj);
2354 static CYTHON_INLINE
int __Pyx_Is_Little_Endian(
void);
2357 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx,
const char* ts);
2358 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
2359 __Pyx_BufFmt_StackElem* stack,
2360 __Pyx_TypeInfo* type);
2363 static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
2366 static int __Pyx_ValidateAndInit_memviewslice(
2371 __Pyx_TypeInfo *dtype,
2372 __Pyx_BufFmt_StackElem stack[],
2373 __Pyx_memviewslice *memviewslice,
2374 PyObject *original_obj);
2377 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *,
int writable_flag);
2380 #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
2381 #define __Pyx_HAS_GCC_DIAGNOSTIC
2387 #define __Pyx_CREAL(z) ((z).real())
2388 #define __Pyx_CIMAG(z) ((z).imag())
2390 #define __Pyx_CREAL(z) (__real__(z))
2391 #define __Pyx_CIMAG(z) (__imag__(z))
2394 #define __Pyx_CREAL(z) ((z).real)
2395 #define __Pyx_CIMAG(z) ((z).imag)
2397 #if defined(__cplusplus) && CYTHON_CCOMPLEX\
2398 && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
2399 #define __Pyx_SET_CREAL(z,x) ((z).real(x))
2400 #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
2402 #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
2403 #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
2408 #define __Pyx_c_eq_float(a, b) ((a)==(b))
2409 #define __Pyx_c_sum_float(a, b) ((a)+(b))
2410 #define __Pyx_c_diff_float(a, b) ((a)-(b))
2411 #define __Pyx_c_prod_float(a, b) ((a)*(b))
2412 #define __Pyx_c_quot_float(a, b) ((a)/(b))
2413 #define __Pyx_c_neg_float(a) (-(a))
2415 #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
2416 #define __Pyx_c_conj_float(z) (::std::conj(z))
2418 #define __Pyx_c_abs_float(z) (::std::abs(z))
2419 #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
2422 #define __Pyx_c_is_zero_float(z) ((z)==0)
2423 #define __Pyx_c_conj_float(z) (conjf(z))
2425 #define __Pyx_c_abs_float(z) (cabsf(z))
2426 #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
2430 static CYTHON_INLINE
int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
2431 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
2432 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
2433 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
2434 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
2435 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
2436 static CYTHON_INLINE
int __Pyx_c_is_zero_float(__pyx_t_float_complex);
2437 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
2439 static CYTHON_INLINE
float __Pyx_c_abs_float(__pyx_t_float_complex);
2440 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
2446 #define __Pyx_c_eq_double(a, b) ((a)==(b))
2447 #define __Pyx_c_sum_double(a, b) ((a)+(b))
2448 #define __Pyx_c_diff_double(a, b) ((a)-(b))
2449 #define __Pyx_c_prod_double(a, b) ((a)*(b))
2450 #define __Pyx_c_quot_double(a, b) ((a)/(b))
2451 #define __Pyx_c_neg_double(a) (-(a))
2453 #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
2454 #define __Pyx_c_conj_double(z) (::std::conj(z))
2456 #define __Pyx_c_abs_double(z) (::std::abs(z))
2457 #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
2460 #define __Pyx_c_is_zero_double(z) ((z)==0)
2461 #define __Pyx_c_conj_double(z) (conj(z))
2463 #define __Pyx_c_abs_double(z) (cabs(z))
2464 #define __Pyx_c_pow_double(a, b) (cpow(a, b))
2468 static CYTHON_INLINE
int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
2469 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
2470 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
2471 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
2472 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
2473 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
2474 static CYTHON_INLINE
int __Pyx_c_is_zero_double(__pyx_t_double_complex);
2475 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
2477 static CYTHON_INLINE
double __Pyx_c_abs_double(__pyx_t_double_complex);
2478 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
2483 static __Pyx_memviewslice
2484 __pyx_memoryview_copy_new_contig(
const __Pyx_memviewslice *from_mvs,
2485 const char *mode,
int ndim,
2486 size_t sizeof_dtype,
int contig_flag,
2487 int dtype_is_object);
2490 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value);
2493 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *);
2496 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *);
2499 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value);
2502 static CYTHON_INLINE
char __Pyx_PyInt_As_char(PyObject *);
2505 static int __Pyx_check_binary_version(
void);
2508 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
2510 static void __pyx_f_18BoundaryConditions_17BoundaryCondition_resetBC(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self,
int __pyx_skip_dispatch);
2511 static PyObject *__pyx_array_get_memview(
struct __pyx_array_obj *__pyx_v_self);
2512 static char *__pyx_memoryview_get_item_pointer(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index);
2513 static PyObject *__pyx_memoryview_is_slice(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj);
2514 static PyObject *__pyx_memoryview_setitem_slice_assignment(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src);
2515 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(
struct __pyx_memoryview_obj *__pyx_v_self,
struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value);
2516 static PyObject *__pyx_memoryview_setitem_indexed(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value);
2517 static PyObject *__pyx_memoryview_convert_item_to_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp);
2518 static PyObject *__pyx_memoryview_assign_item_from_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value);
2519 static PyObject *__pyx_memoryviewslice_convert_item_to_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp);
2520 static PyObject *__pyx_memoryviewslice_assign_item_from_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value);
2535 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
2548 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
2549 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
2550 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
2551 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
2552 static PyTypeObject *__pyx_ptype_5numpy_generic = 0;
2553 static PyTypeObject *__pyx_ptype_5numpy_number = 0;
2554 static PyTypeObject *__pyx_ptype_5numpy_integer = 0;
2555 static PyTypeObject *__pyx_ptype_5numpy_signedinteger = 0;
2556 static PyTypeObject *__pyx_ptype_5numpy_unsignedinteger = 0;
2557 static PyTypeObject *__pyx_ptype_5numpy_inexact = 0;
2558 static PyTypeObject *__pyx_ptype_5numpy_floating = 0;
2559 static PyTypeObject *__pyx_ptype_5numpy_complexfloating = 0;
2560 static PyTypeObject *__pyx_ptype_5numpy_flexible = 0;
2561 static PyTypeObject *__pyx_ptype_5numpy_character = 0;
2562 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
2565 static PyTypeObject *__pyx_ptype_18BoundaryConditions_BC_Base = 0;
2566 static PyTypeObject *__pyx_ptype_18BoundaryConditions_BoundaryCondition = 0;
2567 static PyTypeObject *__pyx_ptype_18BoundaryConditions___pyx_scope_struct__setConstantBC = 0;
2568 static PyTypeObject *__pyx_ptype_18BoundaryConditions___pyx_scope_struct_1_setLinearBC = 0;
2569 static PyTypeObject *__pyx_ptype_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp = 0;
2570 static PyTypeObject *__pyx_array_type = 0;
2571 static PyTypeObject *__pyx_MemviewEnum_type = 0;
2572 static PyTypeObject *__pyx_memoryview_type = 0;
2573 static PyTypeObject *__pyx_memoryviewslice_type = 0;
2574 static PyObject *
generic = 0;
2575 static PyObject *strided = 0;
2576 static PyObject *indirect = 0;
2577 static PyObject *contiguous = 0;
2578 static PyObject *indirect_contiguous = 0;
2579 static int __pyx_memoryview_thread_locks_used;
2580 static PyThread_type_lock __pyx_memoryview_thread_locks[8];
2581 static PyObject *__pyx_f_18BoundaryConditions___pyx_unpickle_BC_Base__set_state(
struct __pyx_obj_18BoundaryConditions_BC_Base *, PyObject *);
2582 static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t,
char *,
char *,
char *);
2583 static void *__pyx_align_pointer(
void *,
size_t);
2584 static PyObject *__pyx_memoryview_new(PyObject *,
int,
int, __Pyx_TypeInfo *);
2585 static CYTHON_INLINE
int __pyx_memoryview_check(PyObject *);
2586 static PyObject *_unellipsify(PyObject *,
int);
2587 static PyObject *assert_direct_dimensions(Py_ssize_t *,
int);
2588 static struct __pyx_memoryview_obj *__pyx_memview_slice(
struct __pyx_memoryview_obj *, PyObject *);
2589 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t,
int,
int,
int *, Py_ssize_t, Py_ssize_t, Py_ssize_t,
int,
int,
int,
int);
2590 static char *__pyx_pybuffer_index(Py_buffer *,
char *, Py_ssize_t, Py_ssize_t);
2591 static int __pyx_memslice_transpose(__Pyx_memviewslice *);
2592 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice,
int, PyObject *(*)(
char *),
int (*)(
char *, PyObject *),
int);
2593 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
2594 static void __pyx_memoryview_slice_copy(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
2595 static PyObject *__pyx_memoryview_copy_object(
struct __pyx_memoryview_obj *);
2596 static PyObject *__pyx_memoryview_copy_object_from_slice(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
2597 static Py_ssize_t abs_py_ssize_t(Py_ssize_t);
2598 static char __pyx_get_best_slice_order(__Pyx_memviewslice *,
int);
2599 static void _copy_strided_to_strided(
char *, Py_ssize_t *,
char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *,
int,
size_t);
2600 static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *,
int,
size_t);
2601 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *,
int);
2602 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t,
int,
char);
2603 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *,
char,
int);
2604 static int __pyx_memoryview_err_extents(
int, Py_ssize_t, Py_ssize_t);
2605 static int __pyx_memoryview_err_dim(PyObject *,
char *,
int);
2606 static int __pyx_memoryview_err(PyObject *,
char *);
2607 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice,
int,
int,
int);
2608 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *,
int,
int);
2609 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *,
int,
int,
int);
2610 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(
char *, Py_ssize_t *, Py_ssize_t *,
int,
int);
2611 static void __pyx_memoryview_refcount_objects_in_slice(
char *, Py_ssize_t *, Py_ssize_t *,
int,
int);
2612 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *,
int,
size_t,
void *,
int);
2613 static void __pyx_memoryview__slice_assign_scalar(
char *, Py_ssize_t *, Py_ssize_t *,
int,
size_t,
void *);
2614 static PyObject *__pyx_unpickle_Enum__set_state(
struct __pyx_MemviewEnum_obj *, PyObject *);
2615 static __Pyx_TypeInfo __Pyx_TypeInfo_double = {
"double", NULL,
sizeof(double), { 0 }, 0,
'R', 0, 0 };
2616 #define __Pyx_MODULE_NAME "BoundaryConditions"
2617 extern int __pyx_module_is_main_BoundaryConditions;
2618 int __pyx_module_is_main_BoundaryConditions = 0;
2621 static PyObject *__pyx_builtin_sum;
2622 static PyObject *__pyx_builtin_TypeError;
2623 static PyObject *__pyx_builtin_ImportError;
2624 static PyObject *__pyx_builtin_ValueError;
2625 static PyObject *__pyx_builtin_MemoryError;
2626 static PyObject *__pyx_builtin_enumerate;
2627 static PyObject *__pyx_builtin_range;
2628 static PyObject *__pyx_builtin_Ellipsis;
2629 static PyObject *__pyx_builtin_id;
2630 static PyObject *__pyx_builtin_IndexError;
2631 static const char __pyx_k_O[] =
"O";
2632 static const char __pyx_k_a[] =
"a";
2633 static const char __pyx_k_c[] =
"c";
2634 static const char __pyx_k_n[] =
"n";
2635 static const char __pyx_k_t[] =
"t";
2636 static const char __pyx_k_x[] =
"x";
2637 static const char __pyx_k_a0[] =
"a0";
2638 static const char __pyx_k_id[] =
"id";
2639 static const char __pyx_k_nd[] =
"nd";
2640 static const char __pyx_k_np[] =
"np";
2641 static const char __pyx_k_t1[] =
"t1";
2642 static const char __pyx_k_all[] =
"__all__";
2643 static const char __pyx_k_b_i[] =
"b_i";
2644 static const char __pyx_k_get[] =
"get";
2645 static const char __pyx_k_new[] =
"__new__";
2646 static const char __pyx_k_obj[] =
"obj";
2647 static const char __pyx_k_sum[] =
"sum";
2648 static const char __pyx_k_None[] =
"None";
2649 static const char __pyx_k_b_or[] =
"b_or";
2650 static const char __pyx_k_base[] =
"base";
2651 static const char __pyx_k_dict[] =
"__dict__";
2652 static const char __pyx_k_main[] =
"__main__";
2653 static const char __pyx_k_mode[] =
"mode";
2654 static const char __pyx_k_name[] =
"name";
2655 static const char __pyx_k_ndim[] =
"ndim";
2656 static const char __pyx_k_pack[] =
"pack";
2657 static const char __pyx_k_self[] =
"self";
2658 static const char __pyx_k_size[] =
"size";
2659 static const char __pyx_k_step[] =
"step";
2660 static const char __pyx_k_stop[] =
"stop";
2661 static const char __pyx_k_test[] =
"__test__";
2662 static const char __pyx_k_ASCII[] =
"ASCII";
2663 static const char __pyx_k_class[] =
"__class__";
2664 static const char __pyx_k_error[] =
"error";
2665 static const char __pyx_k_flags[] =
"flags";
2666 static const char __pyx_k_numpy[] =
"numpy";
2667 static const char __pyx_k_range[] =
"range";
2668 static const char __pyx_k_shape[] =
"shape";
2669 static const char __pyx_k_start[] =
"start";
2670 static const char __pyx_k_state[] =
"state";
2671 static const char __pyx_k_value[] =
"value";
2672 static const char __pyx_k_zeros[] =
"zeros";
2673 static const char __pyx_k_Domain[] =
"Domain";
2674 static const char __pyx_k_dict_2[] =
"_dict";
2675 static const char __pyx_k_encode[] =
"encode";
2676 static const char __pyx_k_format[] =
"format";
2677 static const char __pyx_k_import[] =
"__import__";
2678 static const char __pyx_k_name_2[] =
"__name__";
2679 static const char __pyx_k_pickle[] =
"pickle";
2680 static const char __pyx_k_reduce[] =
"__reduce__";
2681 static const char __pyx_k_struct[] =
"struct";
2682 static const char __pyx_k_unpack[] =
"unpack";
2683 static const char __pyx_k_update[] =
"update";
2684 static const char __pyx_k_BC_Base[] =
"BC_Base";
2685 static const char __pyx_k_Context[] =
"Context";
2686 static const char __pyx_k_context[] =
"context";
2687 static const char __pyx_k_fortran[] =
"fortran";
2688 static const char __pyx_k_memview[] =
"memview";
2689 static const char __pyx_k_proteus[] =
"proteus";
2690 static const char __pyx_k_resetBC[] =
"resetBC";
2691 static const char __pyx_k_Ellipsis[] =
"Ellipsis";
2692 static const char __pyx_k_getstate[] =
"__getstate__";
2693 static const char __pyx_k_itemsize[] =
"itemsize";
2694 static const char __pyx_k_pyx_type[] =
"__pyx_type";
2695 static const char __pyx_k_setstate[] =
"__setstate__";
2696 static const char __pyx_k_TypeError[] =
"TypeError";
2697 static const char __pyx_k_enumerate[] =
"enumerate";
2698 static const char __pyx_k_pyx_state[] =
"__pyx_state";
2699 static const char __pyx_k_reduce_ex[] =
"__reduce_ex__";
2700 static const char __pyx_k_IndexError[] =
"IndexError";
2701 static const char __pyx_k_ValueError[] =
"ValueError";
2702 static const char __pyx_k_getContext[] =
"getContext";
2703 static const char __pyx_k_pyx_result[] =
"__pyx_result";
2704 static const char __pyx_k_pyx_vtable[] =
"__pyx_vtable__";
2705 static const char __pyx_k_ImportError[] =
"ImportError";
2706 static const char __pyx_k_MemoryError[] =
"MemoryError";
2707 static const char __pyx_k_PickleError[] =
"PickleError";
2708 static const char __pyx_k_init_cython[] =
"init_cython";
2709 static const char __pyx_k_setLinearBC[] =
"setLinearBC";
2710 static const char __pyx_k_pyx_checksum[] =
"__pyx_checksum";
2711 static const char __pyx_k_stringsource[] =
"stringsource";
2712 static const char __pyx_k_use_setstate[] =
"use_setstate";
2713 static const char __pyx_k_pyx_getbuffer[] =
"__pyx_getbuffer";
2714 static const char __pyx_k_reduce_cython[] =
"__reduce_cython__";
2715 static const char __pyx_k_setConstantBC[] =
"setConstantBC";
2716 static const char __pyx_k_setLinearRamp[] =
"setLinearRamp";
2717 static const char __pyx_k_View_MemoryView[] =
"View.MemoryView";
2718 static const char __pyx_k_allocate_buffer[] =
"allocate_buffer";
2719 static const char __pyx_k_dtype_is_object[] =
"dtype_is_object";
2720 static const char __pyx_k_pyx_PickleError[] =
"__pyx_PickleError";
2721 static const char __pyx_k_setstate_cython[] =
"__setstate_cython__";
2722 static const char __pyx_k_BoundaryCondition[] =
"BoundaryCondition";
2723 static const char __pyx_k_pyx_unpickle_Enum[] =
"__pyx_unpickle_Enum";
2724 static const char __pyx_k_BC_Base_getContext[] =
"BC_Base.getContext";
2725 static const char __pyx_k_BoundaryConditions[] =
"BoundaryConditions";
2726 static const char __pyx_k_cline_in_traceback[] =
"cline_in_traceback";
2727 static const char __pyx_k_strided_and_direct[] =
"<strided and direct>";
2728 static const char __pyx_k_pyx_unpickle_BC_Base[] =
"__pyx_unpickle_BC_Base";
2729 static const char __pyx_k_strided_and_indirect[] =
"<strided and indirect>";
2730 static const char __pyx_k_contiguous_and_direct[] =
"<contiguous and direct>";
2731 static const char __pyx_k_MemoryView_of_r_object[] =
"<MemoryView of %r object>";
2732 static const char __pyx_k_BC_Base___reduce_cython[] =
"BC_Base.__reduce_cython__";
2733 static const char __pyx_k_MemoryView_of_r_at_0x_x[] =
"<MemoryView of %r at 0x%x>";
2734 static const char __pyx_k_contiguous_and_indirect[] =
"<contiguous and indirect>";
2735 static const char __pyx_k_Cannot_index_with_type_s[] =
"Cannot index with type '%s'";
2736 static const char __pyx_k_BC_Base___setstate_cython[] =
"BC_Base.__setstate_cython__";
2737 static const char __pyx_k_BoundaryCondition_resetBC[] =
"BoundaryCondition.resetBC";
2738 static const char __pyx_k_Invalid_shape_in_axis_d_d[] =
"Invalid shape in axis %d: %d.";
2739 static const char __pyx_k_setLinearBC_locals_lambda[] =
"setLinearBC.<locals>.<lambda>";
2740 static const char __pyx_k_itemsize_0_for_cython_array[] =
"itemsize <= 0 for cython.array";
2741 static const char __pyx_k_setConstantBC_locals_lambda[] =
"setConstantBC.<locals>.<lambda>";
2742 static const char __pyx_k_setLinearRamp_locals_lambda[] =
"setLinearRamp.<locals>.<lambda>";
2743 static const char __pyx_k_BoundaryCondition_init_cython[] =
"BoundaryCondition.init_cython";
2744 static const char __pyx_k_BoundaryCondition_setLinearBC[] =
"BoundaryCondition.setLinearBC";
2745 static const char __pyx_k_proteus_BoundaryConditions_py[] =
"proteus/BoundaryConditions.py";
2746 static const char __pyx_k_unable_to_allocate_array_data[] =
"unable to allocate array data.";
2747 static const char __pyx_k_strided_and_direct_or_indirect[] =
"<strided and direct or indirect>";
2748 static const char __pyx_k_BoundaryCondition_setConstantBC[] =
"BoundaryCondition.setConstantBC";
2749 static const char __pyx_k_BoundaryCondition_setLinearRamp[] =
"BoundaryCondition.setLinearRamp";
2750 static const char __pyx_k_numpy_core_multiarray_failed_to[] =
"numpy.core.multiarray failed to import";
2751 static const char __pyx_k_self_uuOfXT_cannot_be_converted[] =
"self.uuOfXT cannot be converted to a Python object for pickling";
2752 static const char __pyx_k_BoundaryCondition___reduce_cytho[] =
"BoundaryCondition.__reduce_cython__";
2753 static const char __pyx_k_BoundaryCondition___setstate_cyt[] =
"BoundaryCondition.__setstate_cython__";
2754 static const char __pyx_k_Buffer_view_does_not_expose_stri[] =
"Buffer view does not expose strides";
2755 static const char __pyx_k_Can_only_create_a_buffer_that_is[] =
"Can only create a buffer that is contiguous in memory.";
2756 static const char __pyx_k_Cannot_assign_to_read_only_memor[] =
"Cannot assign to read-only memoryview";
2757 static const char __pyx_k_Cannot_create_writable_memory_vi[] =
"Cannot create writable memory view from read-only memoryview";
2758 static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] =
"Empty shape tuple for cython.array";
2759 static const char __pyx_k_Incompatible_checksums_s_vs_0x96[] =
"Incompatible checksums (%s vs 0x96e6a1f = (BC_type, Shape, _b_or, ct, name, nd))";
2760 static const char __pyx_k_Incompatible_checksums_s_vs_0xb0[] =
"Incompatible checksums (%s vs 0xb068931 = (name))";
2761 static const char __pyx_k_Indirect_dimensions_not_supporte[] =
"Indirect dimensions not supported";
2762 static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] =
"Invalid mode, expected 'c' or 'fortran', got %s";
2763 static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] =
"Out of bounds on buffer access (axis %d)";
2764 static const char __pyx_k_Shape_or_nd_must_be_passed_to_BC[] =
"Shape or nd must be passed to BC";
2765 static const char __pyx_k_Unable_to_convert_item_to_object[] =
"Unable to convert item to object";
2766 static const char __pyx_k_got_differing_extents_in_dimensi[] =
"got differing extents in dimension %d (got %d and %d)";
2767 static const char __pyx_k_no_default___reduce___due_to_non[] =
"no default __reduce__ due to non-trivial __cinit__";
2768 static const char __pyx_k_numpy_core_umath_failed_to_impor[] =
"numpy.core.umath failed to import";
2769 static const char __pyx_k_unable_to_allocate_shape_and_str[] =
"unable to allocate shape and strides.";
2770 static PyObject *__pyx_n_s_ASCII;
2771 static PyObject *__pyx_n_s_BC_Base;
2772 static PyObject *__pyx_n_s_BC_Base___reduce_cython;
2773 static PyObject *__pyx_n_s_BC_Base___setstate_cython;
2774 static PyObject *__pyx_n_s_BC_Base_getContext;
2775 static PyObject *__pyx_n_s_BoundaryCondition;
2776 static PyObject *__pyx_n_s_BoundaryCondition___reduce_cytho;
2777 static PyObject *__pyx_n_s_BoundaryCondition___setstate_cyt;
2778 static PyObject *__pyx_n_s_BoundaryCondition_init_cython;
2779 static PyObject *__pyx_n_s_BoundaryCondition_resetBC;
2780 static PyObject *__pyx_n_s_BoundaryCondition_setConstantBC;
2781 static PyObject *__pyx_n_s_BoundaryCondition_setLinearBC;
2782 static PyObject *__pyx_n_s_BoundaryCondition_setLinearRamp;
2783 static PyObject *__pyx_n_s_BoundaryConditions;
2784 static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
2785 static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
2786 static PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor;
2787 static PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi;
2788 static PyObject *__pyx_kp_s_Cannot_index_with_type_s;
2789 static PyObject *__pyx_n_s_Context;
2790 static PyObject *__pyx_n_s_Domain;
2791 static PyObject *__pyx_n_s_Ellipsis;
2792 static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
2793 static PyObject *__pyx_n_s_ImportError;
2794 static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0x96;
2795 static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xb0;
2796 static PyObject *__pyx_n_s_IndexError;
2797 static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
2798 static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr;
2799 static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d;
2800 static PyObject *__pyx_n_s_MemoryError;
2801 static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
2802 static PyObject *__pyx_kp_s_MemoryView_of_r_object;
2803 static PyObject *__pyx_n_s_None;
2804 static PyObject *__pyx_n_b_O;
2805 static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a;
2806 static PyObject *__pyx_n_s_PickleError;
2807 static PyObject *__pyx_kp_s_Shape_or_nd_must_be_passed_to_BC;
2808 static PyObject *__pyx_n_s_TypeError;
2809 static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
2810 static PyObject *__pyx_n_s_ValueError;
2811 static PyObject *__pyx_n_s_View_MemoryView;
2812 static PyObject *__pyx_n_s_a;
2813 static PyObject *__pyx_n_s_a0;
2814 static PyObject *__pyx_n_s_all;
2815 static PyObject *__pyx_n_s_allocate_buffer;
2816 static PyObject *__pyx_n_s_b_i;
2817 static PyObject *__pyx_n_s_b_or;
2818 static PyObject *__pyx_n_s_base;
2819 static PyObject *__pyx_n_s_c;
2820 static PyObject *__pyx_n_u_c;
2821 static PyObject *__pyx_n_s_class;
2822 static PyObject *__pyx_n_s_cline_in_traceback;
2823 static PyObject *__pyx_n_s_context;
2824 static PyObject *__pyx_kp_s_contiguous_and_direct;
2825 static PyObject *__pyx_kp_s_contiguous_and_indirect;
2826 static PyObject *__pyx_n_s_dict;
2827 static PyObject *__pyx_n_s_dict_2;
2828 static PyObject *__pyx_n_s_dtype_is_object;
2829 static PyObject *__pyx_n_s_encode;
2830 static PyObject *__pyx_n_s_enumerate;
2831 static PyObject *__pyx_n_s_error;
2832 static PyObject *__pyx_n_s_flags;
2833 static PyObject *__pyx_n_s_format;
2834 static PyObject *__pyx_n_s_fortran;
2835 static PyObject *__pyx_n_u_fortran;
2836 static PyObject *__pyx_n_s_get;
2837 static PyObject *__pyx_n_s_getContext;
2838 static PyObject *__pyx_n_s_getstate;
2839 static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi;
2840 static PyObject *__pyx_n_s_id;
2841 static PyObject *__pyx_n_s_import;
2842 static PyObject *__pyx_n_s_init_cython;
2843 static PyObject *__pyx_n_s_itemsize;
2844 static PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
2845 static PyObject *__pyx_n_s_main;
2846 static PyObject *__pyx_n_s_memview;
2847 static PyObject *__pyx_n_s_mode;
2848 static PyObject *__pyx_n_s_n;
2849 static PyObject *__pyx_n_s_name;
2850 static PyObject *__pyx_n_s_name_2;
2851 static PyObject *__pyx_n_s_nd;
2852 static PyObject *__pyx_n_s_ndim;
2853 static PyObject *__pyx_n_s_new;
2854 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
2855 static PyObject *__pyx_n_s_np;
2856 static PyObject *__pyx_n_s_numpy;
2857 static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
2858 static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
2859 static PyObject *__pyx_n_s_obj;
2860 static PyObject *__pyx_n_s_pack;
2861 static PyObject *__pyx_n_s_pickle;
2862 static PyObject *__pyx_n_s_proteus;
2863 static PyObject *__pyx_kp_s_proteus_BoundaryConditions_py;
2864 static PyObject *__pyx_n_s_pyx_PickleError;
2865 static PyObject *__pyx_n_s_pyx_checksum;
2866 static PyObject *__pyx_n_s_pyx_getbuffer;
2867 static PyObject *__pyx_n_s_pyx_result;
2868 static PyObject *__pyx_n_s_pyx_state;
2869 static PyObject *__pyx_n_s_pyx_type;
2870 static PyObject *__pyx_n_s_pyx_unpickle_BC_Base;
2871 static PyObject *__pyx_n_s_pyx_unpickle_Enum;
2872 static PyObject *__pyx_n_s_pyx_vtable;
2873 static PyObject *__pyx_n_s_range;
2874 static PyObject *__pyx_n_s_reduce;
2875 static PyObject *__pyx_n_s_reduce_cython;
2876 static PyObject *__pyx_n_s_reduce_ex;
2877 static PyObject *__pyx_n_s_resetBC;
2878 static PyObject *__pyx_n_s_self;
2879 static PyObject *__pyx_kp_s_self_uuOfXT_cannot_be_converted;
2880 static PyObject *__pyx_n_s_setConstantBC;
2881 static PyObject *__pyx_n_s_setConstantBC_locals_lambda;
2882 static PyObject *__pyx_n_s_setLinearBC;
2883 static PyObject *__pyx_n_s_setLinearBC_locals_lambda;
2884 static PyObject *__pyx_n_s_setLinearRamp;
2885 static PyObject *__pyx_n_s_setLinearRamp_locals_lambda;
2886 static PyObject *__pyx_n_s_setstate;
2887 static PyObject *__pyx_n_s_setstate_cython;
2888 static PyObject *__pyx_n_s_shape;
2889 static PyObject *__pyx_n_s_size;
2890 static PyObject *__pyx_n_s_start;
2891 static PyObject *__pyx_n_s_state;
2892 static PyObject *__pyx_n_s_step;
2893 static PyObject *__pyx_n_s_stop;
2894 static PyObject *__pyx_kp_s_strided_and_direct;
2895 static PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
2896 static PyObject *__pyx_kp_s_strided_and_indirect;
2897 static PyObject *__pyx_kp_s_stringsource;
2898 static PyObject *__pyx_n_s_struct;
2899 static PyObject *__pyx_n_s_sum;
2900 static PyObject *__pyx_n_s_t;
2901 static PyObject *__pyx_n_s_t1;
2902 static PyObject *__pyx_n_s_test;
2903 static PyObject *__pyx_kp_s_unable_to_allocate_array_data;
2904 static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
2905 static PyObject *__pyx_n_s_unpack;
2906 static PyObject *__pyx_n_s_update;
2907 static PyObject *__pyx_n_s_use_setstate;
2908 static PyObject *__pyx_n_s_value;
2909 static PyObject *__pyx_n_s_x;
2910 static PyObject *__pyx_n_s_zeros;
2911 static int __pyx_pf_18BoundaryConditions_7BC_Base___init__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_shape, PyObject *__pyx_v_name, PyObject *__pyx_v_b_or, PyObject *__pyx_v_b_i, PyObject *__pyx_v_nd);
2912 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_2getContext(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_context);
2913 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_2nd___get__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self);
2914 static int __pyx_pf_18BoundaryConditions_7BC_Base_2nd_2__set__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value);
2915 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_5Shape___get__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self);
2916 static int __pyx_pf_18BoundaryConditions_7BC_Base_5Shape_2__set__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value);
2917 static int __pyx_pf_18BoundaryConditions_7BC_Base_5Shape_4__del__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self);
2918 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_4name___get__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self);
2919 static int __pyx_pf_18BoundaryConditions_7BC_Base_4name_2__set__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value);
2920 static int __pyx_pf_18BoundaryConditions_7BC_Base_4name_4__del__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self);
2921 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_7BC_type___get__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self);
2922 static int __pyx_pf_18BoundaryConditions_7BC_Base_7BC_type_2__set__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value);
2923 static int __pyx_pf_18BoundaryConditions_7BC_Base_7BC_type_4__del__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self);
2924 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_2ct___get__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self);
2925 static int __pyx_pf_18BoundaryConditions_7BC_Base_2ct_2__set__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value);
2926 static int __pyx_pf_18BoundaryConditions_7BC_Base_2ct_4__del__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self);
2927 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_4__reduce_cython__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self);
2928 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_6__setstate_cython__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v___pyx_state);
2929 static int __pyx_pf_18BoundaryConditions_17BoundaryCondition___init__(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self);
2930 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_2init_cython(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self);
2931 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_4resetBC(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self);
2932 static PyObject *__pyx_pf_18BoundaryConditions_2__defaults__(CYTHON_UNUSED PyObject *__pyx_self);
2933 static PyObject *__pyx_lambda_funcdef_lambda(PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *__pyx_v_t, CYTHON_UNUSED PyObject *__pyx_v_n);
2934 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_6setConstantBC(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_value);
2935 static PyObject *__pyx_pf_18BoundaryConditions_4__defaults__(CYTHON_UNUSED PyObject *__pyx_self);
2936 static PyObject *__pyx_lambda_funcdef_lambda1(PyObject *__pyx_self, PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *__pyx_v_t, CYTHON_UNUSED PyObject *__pyx_v_n);
2937 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_8setLinearBC(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_a0, PyObject *__pyx_v_a);
2938 static PyObject *__pyx_pf_18BoundaryConditions_6__defaults__(CYTHON_UNUSED PyObject *__pyx_self);
2939 static PyObject *__pyx_lambda_funcdef_lambda2(PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_x, PyObject *__pyx_v_t, CYTHON_UNUSED PyObject *__pyx_v_n);
2940 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_10setLinearRamp(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_t1, PyObject *__pyx_v_value);
2941 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT___get__(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self);
2942 static int __pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT_2__set__(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_value);
2943 static int __pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT_4__del__(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self);
2944 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_12__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self);
2945 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_14__setstate_cython__(CYTHON_UNUSED
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
2946 static PyObject *__pyx_pf_18BoundaryConditions___pyx_unpickle_BC_Base(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type,
long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state);
2947 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode,
int __pyx_v_allocate_buffer);
2948 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(
struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
2949 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(
struct __pyx_array_obj *__pyx_v_self);
2950 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(
struct __pyx_array_obj *__pyx_v_self);
2951 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(
struct __pyx_array_obj *__pyx_v_self);
2952 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr);
2953 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item);
2954 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value);
2955 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self);
2956 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
2957 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name);
2958 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(
struct __pyx_MemviewEnum_obj *__pyx_v_self);
2959 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self);
2960 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state);
2961 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj,
int __pyx_v_flags,
int __pyx_v_dtype_is_object);
2962 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(
struct __pyx_memoryview_obj *__pyx_v_self);
2963 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index);
2964 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value);
2965 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(
struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
2966 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2967 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2968 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2969 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2970 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2971 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2972 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2973 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2974 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2975 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(
struct __pyx_memoryview_obj *__pyx_v_self);
2976 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(
struct __pyx_memoryview_obj *__pyx_v_self);
2977 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(
struct __pyx_memoryview_obj *__pyx_v_self);
2978 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(
struct __pyx_memoryview_obj *__pyx_v_self);
2979 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(
struct __pyx_memoryview_obj *__pyx_v_self);
2980 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(
struct __pyx_memoryview_obj *__pyx_v_self);
2981 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(
struct __pyx_memoryview_obj *__pyx_v_self);
2982 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self);
2983 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
2984 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(
struct __pyx_memoryviewslice_obj *__pyx_v_self);
2985 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(
struct __pyx_memoryviewslice_obj *__pyx_v_self);
2986 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self);
2987 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
2988 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type,
long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state);
2989 static PyObject *__pyx_tp_new_18BoundaryConditions_BC_Base(PyTypeObject *t, PyObject *a, PyObject *k);
2990 static PyObject *__pyx_tp_new_18BoundaryConditions_BoundaryCondition(PyTypeObject *t, PyObject *a, PyObject *k);
2991 static PyObject *__pyx_tp_new_18BoundaryConditions___pyx_scope_struct__setConstantBC(PyTypeObject *t, PyObject *a, PyObject *k);
2992 static PyObject *__pyx_tp_new_18BoundaryConditions___pyx_scope_struct_1_setLinearBC(PyTypeObject *t, PyObject *a, PyObject *k);
2993 static PyObject *__pyx_tp_new_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp(PyTypeObject *t, PyObject *a, PyObject *k);
2994 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k);
2995 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k);
2996 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k);
2997 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k);
2998 static PyObject *__pyx_int_0;
2999 static PyObject *__pyx_int_1;
3000 static PyObject *__pyx_int_3;
3001 static PyObject *__pyx_int_158231071;
3002 static PyObject *__pyx_int_184977713;
3003 static PyObject *__pyx_int_neg_1;
3004 static PyObject *__pyx_codeobj_;
3005 static PyObject *__pyx_slice__7;
3006 static PyObject *__pyx_tuple__11;
3007 static PyObject *__pyx_tuple__13;
3008 static PyObject *__pyx_tuple__15;
3009 static PyObject *__pyx_tuple__16;
3010 static PyObject *__pyx_tuple__17;
3011 static PyObject *__pyx_tuple__18;
3012 static PyObject *__pyx_tuple__19;
3013 static PyObject *__pyx_tuple__20;
3014 static PyObject *__pyx_tuple__21;
3015 static PyObject *__pyx_tuple__22;
3016 static PyObject *__pyx_tuple__23;
3017 static PyObject *__pyx_tuple__24;
3018 static PyObject *__pyx_tuple__25;
3019 static PyObject *__pyx_tuple__26;
3020 static PyObject *__pyx_tuple__27;
3021 static PyObject *__pyx_tuple__28;
3022 static PyObject *__pyx_tuple__29;
3023 static PyObject *__pyx_tuple__30;
3024 static PyObject *__pyx_tuple__31;
3025 static PyObject *__pyx_tuple__32;
3026 static PyObject *__pyx_tuple__33;
3027 static PyObject *__pyx_tuple__35;
3028 static PyObject *__pyx_tuple__36;
3029 static PyObject *__pyx_tuple__37;
3030 static PyObject *__pyx_tuple__38;
3031 static PyObject *__pyx_tuple__39;
3032 static PyObject *__pyx_tuple__40;
3033 static PyObject *__pyx_tuple__41;
3034 static PyObject *__pyx_tuple__42;
3035 static PyObject *__pyx_tuple__43;
3036 static PyObject *__pyx_tuple__44;
3037 static PyObject *__pyx_tuple__45;
3038 static PyObject *__pyx_tuple__46;
3039 static PyObject *__pyx_tuple__47;
3040 static PyObject *__pyx_tuple__48;
3041 static PyObject *__pyx_tuple__49;
3042 static PyObject *__pyx_tuple__50;
3043 static PyObject *__pyx_tuple__51;
3044 static PyObject *__pyx_codeobj__2;
3045 static PyObject *__pyx_codeobj__3;
3046 static PyObject *__pyx_codeobj__4;
3047 static PyObject *__pyx_codeobj__5;
3048 static PyObject *__pyx_codeobj__6;
3049 static PyObject *__pyx_codeobj__8;
3050 static PyObject *__pyx_codeobj__9;
3051 static PyObject *__pyx_codeobj__10;
3052 static PyObject *__pyx_codeobj__12;
3053 static PyObject *__pyx_codeobj__14;
3054 static PyObject *__pyx_codeobj__34;
3066 static int __pyx_pw_18BoundaryConditions_7BC_Base_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
3067 static int __pyx_pw_18BoundaryConditions_7BC_Base_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3068 PyObject *__pyx_v_shape = 0;
3069 PyObject *__pyx_v_name = 0;
3070 PyObject *__pyx_v_b_or = 0;
3071 PyObject *__pyx_v_b_i = 0;
3072 PyObject *__pyx_v_nd = 0;
3073 int __pyx_lineno = 0;
3074 const char *__pyx_filename = NULL;
3075 int __pyx_clineno = 0;
3077 __Pyx_RefNannyDeclarations
3078 __Pyx_RefNannySetupContext(
"__init__ (wrapper)", 0);
3080 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_name,&__pyx_n_s_b_or,&__pyx_n_s_b_i,&__pyx_n_s_nd,0};
3081 PyObject* values[5] = {0,0,0,0,0};
3082 values[0] = ((PyObject *)Py_None);
3083 values[1] = ((PyObject *)Py_None);
3084 values[2] = ((PyObject *)Py_None);
3085 values[3] = ((PyObject *)__pyx_int_0);
3086 values[4] = ((PyObject *)Py_None);
3087 if (unlikely(__pyx_kwds)) {
3089 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3091 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3093 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3095 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3097 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3099 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3102 default:
goto __pyx_L5_argtuple_error;
3104 kw_args = PyDict_Size(__pyx_kwds);
3108 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape);
3109 if (value) { values[0] = value; kw_args--; }
3114 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name);
3115 if (value) { values[1] = value; kw_args--; }
3120 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b_or);
3121 if (value) { values[2] = value; kw_args--; }
3126 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b_i);
3127 if (value) { values[3] = value; kw_args--; }
3132 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nd);
3133 if (value) { values[4] = value; kw_args--; }
3136 if (unlikely(kw_args > 0)) {
3137 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__init__") < 0)) __PYX_ERR(0, 24, __pyx_L3_error)
3140 switch (PyTuple_GET_SIZE(__pyx_args)) {
3141 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3143 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3145 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3147 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3149 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3152 default:
goto __pyx_L5_argtuple_error;
3155 __pyx_v_shape = values[0];
3156 __pyx_v_name = values[1];
3157 __pyx_v_b_or = values[2];
3158 __pyx_v_b_i = values[3];
3159 __pyx_v_nd = values[4];
3161 goto __pyx_L4_argument_unpacking_done;
3162 __pyx_L5_argtuple_error:;
3163 __Pyx_RaiseArgtupleInvalid(
"__init__", 0, 0, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 24, __pyx_L3_error)
3165 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3166 __Pyx_RefNannyFinishContext();
3168 __pyx_L4_argument_unpacking_done:;
3169 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base___init__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), __pyx_v_shape, __pyx_v_name, __pyx_v_b_or, __pyx_v_b_i, __pyx_v_nd);
3172 __Pyx_RefNannyFinishContext();
3176 static int __pyx_pf_18BoundaryConditions_7BC_Base___init__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_shape, PyObject *__pyx_v_name, PyObject *__pyx_v_b_or, PyObject *__pyx_v_b_i, PyObject *__pyx_v_nd) {
3178 __Pyx_TraceDeclarations
3179 __Pyx_RefNannyDeclarations
3180 PyObject *__pyx_t_1 = NULL;
3183 PyObject *__pyx_t_4 = NULL;
3185 __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
3186 int __pyx_lineno = 0;
3187 const char *__pyx_filename = NULL;
3188 int __pyx_clineno = 0;
3189 __Pyx_RefNannySetupContext(
"__init__", 0);
3190 __Pyx_TraceCall(
"__init__", __pyx_f[0], 24, 0, __PYX_ERR(0, 24, __pyx_L1_error));
3199 __Pyx_INCREF(__pyx_v_shape);
3200 __Pyx_GIVEREF(__pyx_v_shape);
3201 __Pyx_GOTREF(__pyx_v_self->Shape);
3202 __Pyx_DECREF(__pyx_v_self->Shape);
3203 __pyx_v_self->Shape = __pyx_v_shape;
3212 if (!(likely(PyString_CheckExact(__pyx_v_name))||((__pyx_v_name) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"str", Py_TYPE(__pyx_v_name)->tp_name), 0))) __PYX_ERR(0, 26, __pyx_L1_error)
3213 __pyx_t_1 = __pyx_v_name;
3214 __Pyx_INCREF(__pyx_t_1);
3215 __Pyx_GIVEREF(__pyx_t_1);
3216 __Pyx_GOTREF(__pyx_v_self->name);
3217 __Pyx_DECREF(__pyx_v_self->name);
3218 __pyx_v_self->name = ((PyObject*)__pyx_t_1);
3228 __Pyx_INCREF(__pyx_n_s_None);
3229 __Pyx_GIVEREF(__pyx_n_s_None);
3230 __Pyx_GOTREF(__pyx_v_self->BC_type);
3231 __Pyx_DECREF(__pyx_v_self->BC_type);
3232 __pyx_v_self->BC_type = __pyx_n_s_None;
3241 __pyx_t_2 = (__pyx_v_shape != Py_None);
3242 __pyx_t_3 = (__pyx_t_2 != 0);
3252 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->Shape, __pyx_n_s_Domain);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 29, __pyx_L1_error)
3253 __Pyx_GOTREF(__pyx_t_1);
3254 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_nd);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 29, __pyx_L1_error)
3255 __Pyx_GOTREF(__pyx_t_4);
3256 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3257 __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_4);
if (unlikely((__pyx_t_5 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 29, __pyx_L1_error)
3258 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3259 __pyx_v_self->nd = __pyx_t_5;
3278 __pyx_t_3 = (__pyx_v_nd != Py_None);
3279 __pyx_t_2 = (__pyx_t_3 != 0);
3289 __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_nd);
if (unlikely((__pyx_t_5 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 31, __pyx_L1_error)
3290 __pyx_v_self->nd = __pyx_t_5;
3310 #ifndef CYTHON_WITHOUT_ASSERTIONS
3311 if (unlikely(!Py_OptimizeFlag)) {
3312 __pyx_t_2 = (__pyx_v_nd != Py_None);
3313 if (unlikely(!(__pyx_t_2 != 0))) {
3314 PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_Shape_or_nd_must_be_passed_to_BC);
3315 __PYX_ERR(0, 33, __pyx_L1_error)
3329 __pyx_t_2 = (__pyx_v_b_or != Py_None);
3330 __pyx_t_3 = (__pyx_t_2 != 0);
3340 __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_b_or, __pyx_v_b_i);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 35, __pyx_L1_error)
3341 __Pyx_GOTREF(__pyx_t_4);
3342 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_4, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 35, __pyx_L1_error)
3343 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3344 __PYX_XDEC_MEMVIEW(&__pyx_v_self->_b_or, 0);
3345 __pyx_v_self->_b_or = __pyx_t_6;
3346 __pyx_t_6.memview = NULL;
3347 __pyx_t_6.data = NULL;
3367 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(Py_None, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 37, __pyx_L1_error)
3368 __PYX_XDEC_MEMVIEW(&__pyx_v_self->_b_or, 0);
3369 __pyx_v_self->_b_or = __pyx_t_6;
3370 __pyx_t_6.memview = NULL;
3371 __pyx_t_6.data = NULL;
3387 __Pyx_XDECREF(__pyx_t_1);
3388 __Pyx_XDECREF(__pyx_t_4);
3389 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
3390 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3393 __Pyx_TraceReturn(Py_None, 0);
3394 __Pyx_RefNannyFinishContext();
3407 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_3getContext(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
3408 static char __pyx_doc_18BoundaryConditions_7BC_Base_2getContext[] =
"BC_Base.getContext(self, context=None)\n\n Gets context from proteus.Context or\n\n Parameters\n ----------\n context: class, optional\n if set to None, the context will be created from proteus.Context\n ";
3409 static PyMethodDef __pyx_mdef_18BoundaryConditions_7BC_Base_3getContext = {
"getContext", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_18BoundaryConditions_7BC_Base_3getContext, METH_VARARGS|METH_KEYWORDS, __pyx_doc_18BoundaryConditions_7BC_Base_2getContext};
3410 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_3getContext(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3411 PyObject *__pyx_v_context = 0;
3412 int __pyx_lineno = 0;
3413 const char *__pyx_filename = NULL;
3414 int __pyx_clineno = 0;
3415 PyObject *__pyx_r = 0;
3416 __Pyx_RefNannyDeclarations
3417 __Pyx_RefNannySetupContext(
"getContext (wrapper)", 0);
3419 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_context,0};
3420 PyObject* values[1] = {0};
3421 values[0] = ((PyObject *)Py_None);
3422 if (unlikely(__pyx_kwds)) {
3424 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3426 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3429 default:
goto __pyx_L5_argtuple_error;
3431 kw_args = PyDict_Size(__pyx_kwds);
3435 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_context);
3436 if (value) { values[0] = value; kw_args--; }
3439 if (unlikely(kw_args > 0)) {
3440 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"getContext") < 0)) __PYX_ERR(0, 52, __pyx_L3_error)
3443 switch (PyTuple_GET_SIZE(__pyx_args)) {
3444 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3447 default:
goto __pyx_L5_argtuple_error;
3450 __pyx_v_context = values[0];
3452 goto __pyx_L4_argument_unpacking_done;
3453 __pyx_L5_argtuple_error:;
3454 __Pyx_RaiseArgtupleInvalid(
"getContext", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 52, __pyx_L3_error)
3456 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.getContext", __pyx_clineno, __pyx_lineno, __pyx_filename);
3457 __Pyx_RefNannyFinishContext();
3459 __pyx_L4_argument_unpacking_done:;
3460 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_2getContext(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), __pyx_v_context);
3463 __Pyx_RefNannyFinishContext();
3467 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_2getContext(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_context) {
3468 PyObject *__pyx_v_Context = NULL;
3469 PyObject *__pyx_r = NULL;
3470 __Pyx_TraceDeclarations
3471 __Pyx_RefNannyDeclarations
3473 PyObject *__pyx_t_2 = NULL;
3474 PyObject *__pyx_t_3 = NULL;
3475 PyObject *__pyx_t_4 = NULL;
3476 int __pyx_lineno = 0;
3477 const char *__pyx_filename = NULL;
3478 int __pyx_clineno = 0;
3479 __Pyx_TraceFrameInit(__pyx_codeobj_)
3480 __Pyx_RefNannySetupContext(
"getContext", 0);
3481 __Pyx_TraceCall(
"getContext", __pyx_f[0], 52, 0, __PYX_ERR(0, 52, __pyx_L1_error));
3490 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_context);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 61, __pyx_L1_error)
3500 __pyx_t_2 = PyList_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 62, __pyx_L1_error)
3501 __Pyx_GOTREF(__pyx_t_2);
3502 __Pyx_INCREF(__pyx_n_s_Context);
3503 __Pyx_GIVEREF(__pyx_n_s_Context);
3504 PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Context);
3505 __pyx_t_3 = __Pyx_Import(__pyx_n_s_proteus, __pyx_t_2, -1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 62, __pyx_L1_error)
3506 __Pyx_GOTREF(__pyx_t_3);
3507 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3508 __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_Context);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 62, __pyx_L1_error)
3509 __Pyx_GOTREF(__pyx_t_2);
3510 __Pyx_INCREF(__pyx_t_2);
3511 __pyx_v_Context = __pyx_t_2;
3512 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3513 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3522 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_Context, __pyx_n_s_get);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 63, __pyx_L1_error)
3523 __Pyx_GOTREF(__pyx_t_2);
3525 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
3526 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
3527 if (likely(__pyx_t_4)) {
3528 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
3529 __Pyx_INCREF(__pyx_t_4);
3530 __Pyx_INCREF(
function);
3531 __Pyx_DECREF_SET(__pyx_t_2,
function);
3534 __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
3535 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
3536 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 63, __pyx_L1_error)
3537 __Pyx_GOTREF(__pyx_t_3);
3538 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3539 __Pyx_GIVEREF(__pyx_t_3);
3540 __Pyx_GOTREF(__pyx_v_self->ct);
3541 __Pyx_DECREF(__pyx_v_self->ct);
3542 __pyx_v_self->ct = __pyx_t_3;
3563 __Pyx_INCREF(__pyx_v_context);
3564 __Pyx_GIVEREF(__pyx_v_context);
3565 __Pyx_GOTREF(__pyx_v_self->ct);
3566 __Pyx_DECREF(__pyx_v_self->ct);
3567 __pyx_v_self->ct = __pyx_v_context;
3580 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3583 __Pyx_XDECREF(__pyx_t_2);
3584 __Pyx_XDECREF(__pyx_t_3);
3585 __Pyx_XDECREF(__pyx_t_4);
3586 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.getContext", __pyx_clineno, __pyx_lineno, __pyx_filename);
3589 __Pyx_XDECREF(__pyx_v_Context);
3590 __Pyx_XGIVEREF(__pyx_r);
3591 __Pyx_TraceReturn(__pyx_r, 0);
3592 __Pyx_RefNannyFinishContext();
3605 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_2nd_1__get__(PyObject *__pyx_v_self);
3606 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_2nd_1__get__(PyObject *__pyx_v_self) {
3607 PyObject *__pyx_r = 0;
3608 __Pyx_RefNannyDeclarations
3609 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
3610 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_2nd___get__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
3613 __Pyx_RefNannyFinishContext();
3617 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_2nd___get__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
3618 PyObject *__pyx_r = NULL;
3619 __Pyx_TraceDeclarations
3620 __Pyx_RefNannyDeclarations
3621 PyObject *__pyx_t_1 = NULL;
3622 int __pyx_lineno = 0;
3623 const char *__pyx_filename = NULL;
3624 int __pyx_clineno = 0;
3625 __Pyx_RefNannySetupContext(
"__get__", 0);
3626 __Pyx_TraceCall(
"__get__", __pyx_f[2], 8, 0, __PYX_ERR(2, 8, __pyx_L1_error));
3627 __Pyx_XDECREF(__pyx_r);
3628 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->nd);
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 8, __pyx_L1_error)
3629 __Pyx_GOTREF(__pyx_t_1);
3630 __pyx_r = __pyx_t_1;
3636 __Pyx_XDECREF(__pyx_t_1);
3637 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.nd.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3640 __Pyx_XGIVEREF(__pyx_r);
3641 __Pyx_TraceReturn(__pyx_r, 0);
3642 __Pyx_RefNannyFinishContext();
3647 static int __pyx_pw_18BoundaryConditions_7BC_Base_2nd_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value);
3648 static int __pyx_pw_18BoundaryConditions_7BC_Base_2nd_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
3650 __Pyx_RefNannyDeclarations
3651 __Pyx_RefNannySetupContext(
"__set__ (wrapper)", 0);
3652 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_2nd_2__set__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), ((PyObject *)__pyx_v_value));
3655 __Pyx_RefNannyFinishContext();
3659 static int __pyx_pf_18BoundaryConditions_7BC_Base_2nd_2__set__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value) {
3661 __Pyx_TraceDeclarations
3662 __Pyx_RefNannyDeclarations
3664 int __pyx_lineno = 0;
3665 const char *__pyx_filename = NULL;
3666 int __pyx_clineno = 0;
3667 __Pyx_RefNannySetupContext(
"__set__", 0);
3668 __Pyx_TraceCall(
"__set__", __pyx_f[2], 8, 0, __PYX_ERR(2, 8, __pyx_L1_error));
3669 __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value);
if (unlikely((__pyx_t_1 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(2, 8, __pyx_L1_error)
3670 __pyx_v_self->nd = __pyx_t_1;
3676 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.nd.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3679 __Pyx_TraceReturn(Py_None, 0);
3680 __Pyx_RefNannyFinishContext();
3693 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_5Shape_1__get__(PyObject *__pyx_v_self);
3694 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_5Shape_1__get__(PyObject *__pyx_v_self) {
3695 PyObject *__pyx_r = 0;
3696 __Pyx_RefNannyDeclarations
3697 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
3698 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_5Shape___get__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
3701 __Pyx_RefNannyFinishContext();
3705 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_5Shape___get__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
3706 PyObject *__pyx_r = NULL;
3707 __Pyx_TraceDeclarations
3708 __Pyx_RefNannyDeclarations
3709 int __pyx_lineno = 0;
3710 const char *__pyx_filename = NULL;
3711 int __pyx_clineno = 0;
3712 __Pyx_RefNannySetupContext(
"__get__", 0);
3713 __Pyx_TraceCall(
"__get__", __pyx_f[2], 9, 0, __PYX_ERR(2, 9, __pyx_L1_error));
3714 __Pyx_XDECREF(__pyx_r);
3715 __Pyx_INCREF(__pyx_v_self->Shape);
3716 __pyx_r = __pyx_v_self->Shape;
3721 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.Shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3724 __Pyx_XGIVEREF(__pyx_r);
3725 __Pyx_TraceReturn(__pyx_r, 0);
3726 __Pyx_RefNannyFinishContext();
3731 static int __pyx_pw_18BoundaryConditions_7BC_Base_5Shape_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value);
3732 static int __pyx_pw_18BoundaryConditions_7BC_Base_5Shape_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
3734 __Pyx_RefNannyDeclarations
3735 __Pyx_RefNannySetupContext(
"__set__ (wrapper)", 0);
3736 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_5Shape_2__set__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), ((PyObject *)__pyx_v_value));
3739 __Pyx_RefNannyFinishContext();
3743 static int __pyx_pf_18BoundaryConditions_7BC_Base_5Shape_2__set__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value) {
3745 __Pyx_TraceDeclarations
3746 __Pyx_RefNannyDeclarations
3747 int __pyx_lineno = 0;
3748 const char *__pyx_filename = NULL;
3749 int __pyx_clineno = 0;
3750 __Pyx_RefNannySetupContext(
"__set__", 0);
3751 __Pyx_TraceCall(
"__set__", __pyx_f[2], 9, 0, __PYX_ERR(2, 9, __pyx_L1_error));
3752 __Pyx_INCREF(__pyx_v_value);
3753 __Pyx_GIVEREF(__pyx_v_value);
3754 __Pyx_GOTREF(__pyx_v_self->Shape);
3755 __Pyx_DECREF(__pyx_v_self->Shape);
3756 __pyx_v_self->Shape = __pyx_v_value;
3762 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.Shape.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3765 __Pyx_TraceReturn(Py_None, 0);
3766 __Pyx_RefNannyFinishContext();
3771 static int __pyx_pw_18BoundaryConditions_7BC_Base_5Shape_5__del__(PyObject *__pyx_v_self);
3772 static int __pyx_pw_18BoundaryConditions_7BC_Base_5Shape_5__del__(PyObject *__pyx_v_self) {
3774 __Pyx_RefNannyDeclarations
3775 __Pyx_RefNannySetupContext(
"__del__ (wrapper)", 0);
3776 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_5Shape_4__del__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
3779 __Pyx_RefNannyFinishContext();
3783 static int __pyx_pf_18BoundaryConditions_7BC_Base_5Shape_4__del__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
3785 __Pyx_TraceDeclarations
3786 __Pyx_RefNannyDeclarations
3787 int __pyx_lineno = 0;
3788 const char *__pyx_filename = NULL;
3789 int __pyx_clineno = 0;
3790 __Pyx_RefNannySetupContext(
"__del__", 0);
3791 __Pyx_TraceCall(
"__del__", __pyx_f[2], 9, 0, __PYX_ERR(2, 9, __pyx_L1_error));
3792 __Pyx_INCREF(Py_None);
3793 __Pyx_GIVEREF(Py_None);
3794 __Pyx_GOTREF(__pyx_v_self->Shape);
3795 __Pyx_DECREF(__pyx_v_self->Shape);
3796 __pyx_v_self->Shape = Py_None;
3802 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.Shape.__del__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3805 __Pyx_TraceReturn(Py_None, 0);
3806 __Pyx_RefNannyFinishContext();
3819 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_4name_1__get__(PyObject *__pyx_v_self);
3820 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_4name_1__get__(PyObject *__pyx_v_self) {
3821 PyObject *__pyx_r = 0;
3822 __Pyx_RefNannyDeclarations
3823 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
3824 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_4name___get__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
3827 __Pyx_RefNannyFinishContext();
3831 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_4name___get__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
3832 PyObject *__pyx_r = NULL;
3833 __Pyx_TraceDeclarations
3834 __Pyx_RefNannyDeclarations
3835 int __pyx_lineno = 0;
3836 const char *__pyx_filename = NULL;
3837 int __pyx_clineno = 0;
3838 __Pyx_RefNannySetupContext(
"__get__", 0);
3839 __Pyx_TraceCall(
"__get__", __pyx_f[2], 10, 0, __PYX_ERR(2, 10, __pyx_L1_error));
3840 __Pyx_XDECREF(__pyx_r);
3841 __Pyx_INCREF(__pyx_v_self->name);
3842 __pyx_r = __pyx_v_self->name;
3847 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.name.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3850 __Pyx_XGIVEREF(__pyx_r);
3851 __Pyx_TraceReturn(__pyx_r, 0);
3852 __Pyx_RefNannyFinishContext();
3857 static int __pyx_pw_18BoundaryConditions_7BC_Base_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value);
3858 static int __pyx_pw_18BoundaryConditions_7BC_Base_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
3860 __Pyx_RefNannyDeclarations
3861 __Pyx_RefNannySetupContext(
"__set__ (wrapper)", 0);
3862 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_4name_2__set__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), ((PyObject *)__pyx_v_value));
3865 __Pyx_RefNannyFinishContext();
3869 static int __pyx_pf_18BoundaryConditions_7BC_Base_4name_2__set__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value) {
3871 __Pyx_TraceDeclarations
3872 __Pyx_RefNannyDeclarations
3873 PyObject *__pyx_t_1 = NULL;
3874 int __pyx_lineno = 0;
3875 const char *__pyx_filename = NULL;
3876 int __pyx_clineno = 0;
3877 __Pyx_RefNannySetupContext(
"__set__", 0);
3878 __Pyx_TraceCall(
"__set__", __pyx_f[2], 10, 0, __PYX_ERR(2, 10, __pyx_L1_error));
3879 if (!(likely(PyString_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"str", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(2, 10, __pyx_L1_error)
3880 __pyx_t_1 = __pyx_v_value;
3881 __Pyx_INCREF(__pyx_t_1);
3882 __Pyx_GIVEREF(__pyx_t_1);
3883 __Pyx_GOTREF(__pyx_v_self->name);
3884 __Pyx_DECREF(__pyx_v_self->name);
3885 __pyx_v_self->name = ((PyObject*)__pyx_t_1);
3892 __Pyx_XDECREF(__pyx_t_1);
3893 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.name.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3896 __Pyx_TraceReturn(Py_None, 0);
3897 __Pyx_RefNannyFinishContext();
3902 static int __pyx_pw_18BoundaryConditions_7BC_Base_4name_5__del__(PyObject *__pyx_v_self);
3903 static int __pyx_pw_18BoundaryConditions_7BC_Base_4name_5__del__(PyObject *__pyx_v_self) {
3905 __Pyx_RefNannyDeclarations
3906 __Pyx_RefNannySetupContext(
"__del__ (wrapper)", 0);
3907 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_4name_4__del__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
3910 __Pyx_RefNannyFinishContext();
3914 static int __pyx_pf_18BoundaryConditions_7BC_Base_4name_4__del__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
3916 __Pyx_TraceDeclarations
3917 __Pyx_RefNannyDeclarations
3918 int __pyx_lineno = 0;
3919 const char *__pyx_filename = NULL;
3920 int __pyx_clineno = 0;
3921 __Pyx_RefNannySetupContext(
"__del__", 0);
3922 __Pyx_TraceCall(
"__del__", __pyx_f[2], 10, 0, __PYX_ERR(2, 10, __pyx_L1_error));
3923 __Pyx_INCREF(Py_None);
3924 __Pyx_GIVEREF(Py_None);
3925 __Pyx_GOTREF(__pyx_v_self->name);
3926 __Pyx_DECREF(__pyx_v_self->name);
3927 __pyx_v_self->name = ((PyObject*)Py_None);
3933 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.name.__del__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3936 __Pyx_TraceReturn(Py_None, 0);
3937 __Pyx_RefNannyFinishContext();
3950 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_1__get__(PyObject *__pyx_v_self);
3951 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_1__get__(PyObject *__pyx_v_self) {
3952 PyObject *__pyx_r = 0;
3953 __Pyx_RefNannyDeclarations
3954 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
3955 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_7BC_type___get__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
3958 __Pyx_RefNannyFinishContext();
3962 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_7BC_type___get__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
3963 PyObject *__pyx_r = NULL;
3964 __Pyx_TraceDeclarations
3965 __Pyx_RefNannyDeclarations
3966 int __pyx_lineno = 0;
3967 const char *__pyx_filename = NULL;
3968 int __pyx_clineno = 0;
3969 __Pyx_RefNannySetupContext(
"__get__", 0);
3970 __Pyx_TraceCall(
"__get__", __pyx_f[2], 11, 0, __PYX_ERR(2, 11, __pyx_L1_error));
3971 __Pyx_XDECREF(__pyx_r);
3972 __Pyx_INCREF(__pyx_v_self->BC_type);
3973 __pyx_r = __pyx_v_self->BC_type;
3978 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.BC_type.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3981 __Pyx_XGIVEREF(__pyx_r);
3982 __Pyx_TraceReturn(__pyx_r, 0);
3983 __Pyx_RefNannyFinishContext();
3988 static int __pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value);
3989 static int __pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
3991 __Pyx_RefNannyDeclarations
3992 __Pyx_RefNannySetupContext(
"__set__ (wrapper)", 0);
3993 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_7BC_type_2__set__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), ((PyObject *)__pyx_v_value));
3996 __Pyx_RefNannyFinishContext();
4000 static int __pyx_pf_18BoundaryConditions_7BC_Base_7BC_type_2__set__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value) {
4002 __Pyx_TraceDeclarations
4003 __Pyx_RefNannyDeclarations
4004 PyObject *__pyx_t_1 = NULL;
4005 int __pyx_lineno = 0;
4006 const char *__pyx_filename = NULL;
4007 int __pyx_clineno = 0;
4008 __Pyx_RefNannySetupContext(
"__set__", 0);
4009 __Pyx_TraceCall(
"__set__", __pyx_f[2], 11, 0, __PYX_ERR(2, 11, __pyx_L1_error));
4010 if (!(likely(PyString_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"str", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(2, 11, __pyx_L1_error)
4011 __pyx_t_1 = __pyx_v_value;
4012 __Pyx_INCREF(__pyx_t_1);
4013 __Pyx_GIVEREF(__pyx_t_1);
4014 __Pyx_GOTREF(__pyx_v_self->BC_type);
4015 __Pyx_DECREF(__pyx_v_self->BC_type);
4016 __pyx_v_self->BC_type = ((PyObject*)__pyx_t_1);
4023 __Pyx_XDECREF(__pyx_t_1);
4024 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.BC_type.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4027 __Pyx_TraceReturn(Py_None, 0);
4028 __Pyx_RefNannyFinishContext();
4033 static int __pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_5__del__(PyObject *__pyx_v_self);
4034 static int __pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_5__del__(PyObject *__pyx_v_self) {
4036 __Pyx_RefNannyDeclarations
4037 __Pyx_RefNannySetupContext(
"__del__ (wrapper)", 0);
4038 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_7BC_type_4__del__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
4041 __Pyx_RefNannyFinishContext();
4045 static int __pyx_pf_18BoundaryConditions_7BC_Base_7BC_type_4__del__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
4047 __Pyx_TraceDeclarations
4048 __Pyx_RefNannyDeclarations
4049 int __pyx_lineno = 0;
4050 const char *__pyx_filename = NULL;
4051 int __pyx_clineno = 0;
4052 __Pyx_RefNannySetupContext(
"__del__", 0);
4053 __Pyx_TraceCall(
"__del__", __pyx_f[2], 11, 0, __PYX_ERR(2, 11, __pyx_L1_error));
4054 __Pyx_INCREF(Py_None);
4055 __Pyx_GIVEREF(Py_None);
4056 __Pyx_GOTREF(__pyx_v_self->BC_type);
4057 __Pyx_DECREF(__pyx_v_self->BC_type);
4058 __pyx_v_self->BC_type = ((PyObject*)Py_None);
4064 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.BC_type.__del__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4067 __Pyx_TraceReturn(Py_None, 0);
4068 __Pyx_RefNannyFinishContext();
4081 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_2ct_1__get__(PyObject *__pyx_v_self);
4082 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_2ct_1__get__(PyObject *__pyx_v_self) {
4083 PyObject *__pyx_r = 0;
4084 __Pyx_RefNannyDeclarations
4085 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
4086 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_2ct___get__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
4089 __Pyx_RefNannyFinishContext();
4093 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_2ct___get__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
4094 PyObject *__pyx_r = NULL;
4095 __Pyx_TraceDeclarations
4096 __Pyx_RefNannyDeclarations
4097 int __pyx_lineno = 0;
4098 const char *__pyx_filename = NULL;
4099 int __pyx_clineno = 0;
4100 __Pyx_RefNannySetupContext(
"__get__", 0);
4101 __Pyx_TraceCall(
"__get__", __pyx_f[2], 12, 0, __PYX_ERR(2, 12, __pyx_L1_error));
4102 __Pyx_XDECREF(__pyx_r);
4103 __Pyx_INCREF(__pyx_v_self->ct);
4104 __pyx_r = __pyx_v_self->ct;
4109 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.ct.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4112 __Pyx_XGIVEREF(__pyx_r);
4113 __Pyx_TraceReturn(__pyx_r, 0);
4114 __Pyx_RefNannyFinishContext();
4119 static int __pyx_pw_18BoundaryConditions_7BC_Base_2ct_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value);
4120 static int __pyx_pw_18BoundaryConditions_7BC_Base_2ct_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
4122 __Pyx_RefNannyDeclarations
4123 __Pyx_RefNannySetupContext(
"__set__ (wrapper)", 0);
4124 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_2ct_2__set__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), ((PyObject *)__pyx_v_value));
4127 __Pyx_RefNannyFinishContext();
4131 static int __pyx_pf_18BoundaryConditions_7BC_Base_2ct_2__set__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value) {
4133 __Pyx_TraceDeclarations
4134 __Pyx_RefNannyDeclarations
4135 int __pyx_lineno = 0;
4136 const char *__pyx_filename = NULL;
4137 int __pyx_clineno = 0;
4138 __Pyx_RefNannySetupContext(
"__set__", 0);
4139 __Pyx_TraceCall(
"__set__", __pyx_f[2], 12, 0, __PYX_ERR(2, 12, __pyx_L1_error));
4140 __Pyx_INCREF(__pyx_v_value);
4141 __Pyx_GIVEREF(__pyx_v_value);
4142 __Pyx_GOTREF(__pyx_v_self->ct);
4143 __Pyx_DECREF(__pyx_v_self->ct);
4144 __pyx_v_self->ct = __pyx_v_value;
4150 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.ct.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4153 __Pyx_TraceReturn(Py_None, 0);
4154 __Pyx_RefNannyFinishContext();
4159 static int __pyx_pw_18BoundaryConditions_7BC_Base_2ct_5__del__(PyObject *__pyx_v_self);
4160 static int __pyx_pw_18BoundaryConditions_7BC_Base_2ct_5__del__(PyObject *__pyx_v_self) {
4162 __Pyx_RefNannyDeclarations
4163 __Pyx_RefNannySetupContext(
"__del__ (wrapper)", 0);
4164 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_2ct_4__del__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
4167 __Pyx_RefNannyFinishContext();
4171 static int __pyx_pf_18BoundaryConditions_7BC_Base_2ct_4__del__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
4173 __Pyx_TraceDeclarations
4174 __Pyx_RefNannyDeclarations
4175 int __pyx_lineno = 0;
4176 const char *__pyx_filename = NULL;
4177 int __pyx_clineno = 0;
4178 __Pyx_RefNannySetupContext(
"__del__", 0);
4179 __Pyx_TraceCall(
"__del__", __pyx_f[2], 12, 0, __PYX_ERR(2, 12, __pyx_L1_error));
4180 __Pyx_INCREF(Py_None);
4181 __Pyx_GIVEREF(Py_None);
4182 __Pyx_GOTREF(__pyx_v_self->ct);
4183 __Pyx_DECREF(__pyx_v_self->ct);
4184 __pyx_v_self->ct = Py_None;
4190 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.ct.__del__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4193 __Pyx_TraceReturn(Py_None, 0);
4194 __Pyx_RefNannyFinishContext();
4205 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
4206 static char __pyx_doc_18BoundaryConditions_7BC_Base_4__reduce_cython__[] =
"BC_Base.__reduce_cython__(self)";
4207 static PyMethodDef __pyx_mdef_18BoundaryConditions_7BC_Base_5__reduce_cython__ = {
"__reduce_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_7BC_Base_5__reduce_cython__, METH_NOARGS, __pyx_doc_18BoundaryConditions_7BC_Base_4__reduce_cython__};
4208 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4209 PyObject *__pyx_r = 0;
4210 __Pyx_RefNannyDeclarations
4211 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
4212 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_4__reduce_cython__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
4215 __Pyx_RefNannyFinishContext();
4219 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_4__reduce_cython__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
4220 PyObject *__pyx_v_state = 0;
4221 PyObject *__pyx_v__dict = 0;
4222 int __pyx_v_use_setstate;
4223 PyObject *__pyx_r = NULL;
4224 __Pyx_TraceDeclarations
4225 __Pyx_RefNannyDeclarations
4226 PyObject *__pyx_t_1 = NULL;
4227 PyObject *__pyx_t_2 = NULL;
4228 PyObject *__pyx_t_3 = NULL;
4232 int __pyx_lineno = 0;
4233 const char *__pyx_filename = NULL;
4234 int __pyx_clineno = 0;
4235 __Pyx_TraceFrameInit(__pyx_codeobj__2)
4236 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
4237 __Pyx_TraceCall(
"__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
4246 __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_self->_b_or, 1, (PyObject *(*)(
char *)) __pyx_memview_get_double, (int (*)(
char *, PyObject *)) __pyx_memview_set_double, 0);;
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
4247 __Pyx_GOTREF(__pyx_t_1);
4248 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->nd);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
4249 __Pyx_GOTREF(__pyx_t_2);
4250 __pyx_t_3 = PyTuple_New(6);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
4251 __Pyx_GOTREF(__pyx_t_3);
4252 __Pyx_INCREF(__pyx_v_self->BC_type);
4253 __Pyx_GIVEREF(__pyx_v_self->BC_type);
4254 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self->BC_type);
4255 __Pyx_INCREF(__pyx_v_self->Shape);
4256 __Pyx_GIVEREF(__pyx_v_self->Shape);
4257 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self->Shape);
4258 __Pyx_GIVEREF(__pyx_t_1);
4259 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_1);
4260 __Pyx_INCREF(__pyx_v_self->ct);
4261 __Pyx_GIVEREF(__pyx_v_self->ct);
4262 PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_self->ct);
4263 __Pyx_INCREF(__pyx_v_self->name);
4264 __Pyx_GIVEREF(__pyx_v_self->name);
4265 PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_v_self->name);
4266 __Pyx_GIVEREF(__pyx_t_2);
4267 PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_t_2);
4270 __pyx_v_state = ((PyObject*)__pyx_t_3);
4280 __pyx_t_3 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
4281 __Pyx_GOTREF(__pyx_t_3);
4282 __pyx_v__dict = __pyx_t_3;
4292 __pyx_t_4 = (__pyx_v__dict != Py_None);
4293 __pyx_t_5 = (__pyx_t_4 != 0);
4303 __pyx_t_3 = PyTuple_New(1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 8, __pyx_L1_error)
4304 __Pyx_GOTREF(__pyx_t_3);
4305 __Pyx_INCREF(__pyx_v__dict);
4306 __Pyx_GIVEREF(__pyx_v__dict);
4307 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v__dict);
4308 __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 8, __pyx_L1_error)
4309 __Pyx_GOTREF(__pyx_t_2);
4310 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4311 __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_2));
4321 __pyx_v_use_setstate = 1;
4341 __pyx_t_4 = (__pyx_v_self->BC_type != ((PyObject*)Py_None));
4342 __pyx_t_6 = (__pyx_t_4 != 0);
4345 __pyx_t_5 = __pyx_t_6;
4346 goto __pyx_L4_bool_binop_done;
4348 __pyx_t_6 = (__pyx_v_self->Shape != Py_None);
4349 __pyx_t_4 = (__pyx_t_6 != 0);
4352 __pyx_t_5 = __pyx_t_4;
4353 goto __pyx_L4_bool_binop_done;
4355 __pyx_t_4 = (__pyx_v_self->ct != Py_None);
4356 __pyx_t_6 = (__pyx_t_4 != 0);
4359 __pyx_t_5 = __pyx_t_6;
4360 goto __pyx_L4_bool_binop_done;
4362 __pyx_t_6 = (__pyx_v_self->name != ((PyObject*)Py_None));
4363 __pyx_t_4 = (__pyx_t_6 != 0);
4364 __pyx_t_5 = __pyx_t_4;
4365 __pyx_L4_bool_binop_done:;
4366 __pyx_v_use_setstate = __pyx_t_5;
4377 __pyx_t_5 = (__pyx_v_use_setstate != 0);
4387 __Pyx_XDECREF(__pyx_r);
4388 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_pyx_unpickle_BC_Base);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 13, __pyx_L1_error)
4389 __Pyx_GOTREF(__pyx_t_2);
4390 __pyx_t_3 = PyTuple_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error)
4391 __Pyx_GOTREF(__pyx_t_3);
4392 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
4393 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
4394 PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
4395 __Pyx_INCREF(__pyx_int_158231071);
4396 __Pyx_GIVEREF(__pyx_int_158231071);
4397 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_158231071);
4398 __Pyx_INCREF(Py_None);
4399 __Pyx_GIVEREF(Py_None);
4400 PyTuple_SET_ITEM(__pyx_t_3, 2, Py_None);
4401 __pyx_t_1 = PyTuple_New(3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
4402 __Pyx_GOTREF(__pyx_t_1);
4403 __Pyx_GIVEREF(__pyx_t_2);
4404 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
4405 __Pyx_GIVEREF(__pyx_t_3);
4406 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
4407 __Pyx_INCREF(__pyx_v_state);
4408 __Pyx_GIVEREF(__pyx_v_state);
4409 PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
4412 __pyx_r = __pyx_t_1;
4433 __Pyx_XDECREF(__pyx_r);
4434 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_pyx_unpickle_BC_Base);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
4435 __Pyx_GOTREF(__pyx_t_1);
4436 __pyx_t_3 = PyTuple_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 15, __pyx_L1_error)
4437 __Pyx_GOTREF(__pyx_t_3);
4438 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
4439 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
4440 PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
4441 __Pyx_INCREF(__pyx_int_158231071);
4442 __Pyx_GIVEREF(__pyx_int_158231071);
4443 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_158231071);
4444 __Pyx_INCREF(__pyx_v_state);
4445 __Pyx_GIVEREF(__pyx_v_state);
4446 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_state);
4447 __pyx_t_2 = PyTuple_New(2);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 15, __pyx_L1_error)
4448 __Pyx_GOTREF(__pyx_t_2);
4449 __Pyx_GIVEREF(__pyx_t_1);
4450 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
4451 __Pyx_GIVEREF(__pyx_t_3);
4452 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
4455 __pyx_r = __pyx_t_2;
4468 __Pyx_XDECREF(__pyx_t_1);
4469 __Pyx_XDECREF(__pyx_t_2);
4470 __Pyx_XDECREF(__pyx_t_3);
4471 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4474 __Pyx_XDECREF(__pyx_v_state);
4475 __Pyx_XDECREF(__pyx_v__dict);
4476 __Pyx_XGIVEREF(__pyx_r);
4477 __Pyx_TraceReturn(__pyx_r, 0);
4478 __Pyx_RefNannyFinishContext();
4490 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
4491 static char __pyx_doc_18BoundaryConditions_7BC_Base_6__setstate_cython__[] =
"BC_Base.__setstate_cython__(self, __pyx_state)";
4492 static PyMethodDef __pyx_mdef_18BoundaryConditions_7BC_Base_7__setstate_cython__ = {
"__setstate_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_7BC_Base_7__setstate_cython__, METH_O, __pyx_doc_18BoundaryConditions_7BC_Base_6__setstate_cython__};
4493 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
4494 PyObject *__pyx_r = 0;
4495 __Pyx_RefNannyDeclarations
4496 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
4497 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_6__setstate_cython__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
4500 __Pyx_RefNannyFinishContext();
4504 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_6__setstate_cython__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
4505 PyObject *__pyx_r = NULL;
4506 __Pyx_TraceDeclarations
4507 __Pyx_RefNannyDeclarations
4508 PyObject *__pyx_t_1 = NULL;
4509 int __pyx_lineno = 0;
4510 const char *__pyx_filename = NULL;
4511 int __pyx_clineno = 0;
4512 __Pyx_TraceFrameInit(__pyx_codeobj__3)
4513 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
4514 __Pyx_TraceCall(
"__setstate_cython__", __pyx_f[1], 16, 0, __PYX_ERR(1, 16, __pyx_L1_error));
4521 if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
4522 __pyx_t_1 = __pyx_f_18BoundaryConditions___pyx_unpickle_BC_Base__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
4523 __Pyx_GOTREF(__pyx_t_1);
4524 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4534 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4537 __Pyx_XDECREF(__pyx_t_1);
4538 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4541 __Pyx_XGIVEREF(__pyx_r);
4542 __Pyx_TraceReturn(__pyx_r, 0);
4543 __Pyx_RefNannyFinishContext();
4556 static int __pyx_pw_18BoundaryConditions_17BoundaryCondition_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
4557 static int __pyx_pw_18BoundaryConditions_17BoundaryCondition_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4559 __Pyx_RefNannyDeclarations
4560 __Pyx_RefNannySetupContext(
"__init__ (wrapper)", 0);
4561 if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
4562 __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args));
return -1;}
4563 if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds,
"__init__", 0)))
return -1;
4564 __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition___init__(((
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self));
4567 __Pyx_RefNannyFinishContext();
4571 static int __pyx_pf_18BoundaryConditions_17BoundaryCondition___init__(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self) {
4573 __Pyx_TraceDeclarations
4574 __Pyx_RefNannyDeclarations
4575 int __pyx_lineno = 0;
4576 const char *__pyx_filename = NULL;
4577 int __pyx_clineno = 0;
4578 __Pyx_RefNannySetupContext(
"__init__", 0);
4579 __Pyx_TraceCall(
"__init__", __pyx_f[0], 78, 0, __PYX_ERR(0, 78, __pyx_L1_error));
4588 __Pyx_INCREF(Py_None);
4589 __Pyx_GIVEREF(Py_None);
4590 __Pyx_GOTREF(__pyx_v_self->uOfXT);
4591 __Pyx_DECREF(__pyx_v_self->uOfXT);
4592 __pyx_v_self->uOfXT = Py_None;
4606 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4609 __Pyx_TraceReturn(Py_None, 0);
4610 __Pyx_RefNannyFinishContext();
4623 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_3init_cython(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
4624 static char __pyx_doc_18BoundaryConditions_17BoundaryCondition_2init_cython[] =
"BoundaryCondition.init_cython(self)";
4625 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_3init_cython = {
"init_cython", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_3init_cython, METH_NOARGS, __pyx_doc_18BoundaryConditions_17BoundaryCondition_2init_cython};
4626 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_3init_cython(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4627 PyObject *__pyx_r = 0;
4628 __Pyx_RefNannyDeclarations
4629 __Pyx_RefNannySetupContext(
"init_cython (wrapper)", 0);
4630 __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_2init_cython(((
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self));
4633 __Pyx_RefNannyFinishContext();
4637 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_2init_cython(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self) {
4638 PyObject *__pyx_r = NULL;
4639 __Pyx_TraceDeclarations
4640 __Pyx_RefNannyDeclarations
4641 int __pyx_lineno = 0;
4642 const char *__pyx_filename = NULL;
4643 int __pyx_clineno = 0;
4644 __Pyx_TraceFrameInit(__pyx_codeobj__4)
4645 __Pyx_RefNannySetupContext(
"init_cython", 0);
4646 __Pyx_TraceCall(
"init_cython", __pyx_f[0], 81, 0, __PYX_ERR(0, 81, __pyx_L1_error));
4655 __Pyx_XDECREF(__pyx_r);
4656 __Pyx_INCREF(__pyx_v_self->uOfXT);
4657 __pyx_r = __pyx_v_self->uOfXT;
4670 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.init_cython", __pyx_clineno, __pyx_lineno, __pyx_filename);
4673 __Pyx_XGIVEREF(__pyx_r);
4674 __Pyx_TraceReturn(__pyx_r, 0);
4675 __Pyx_RefNannyFinishContext();
4687 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_5resetBC(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
4688 static void __pyx_f_18BoundaryConditions_17BoundaryCondition_resetBC(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self,
int __pyx_skip_dispatch) {
4689 __Pyx_TraceDeclarations
4690 __Pyx_RefNannyDeclarations
4691 PyObject *__pyx_t_1 = NULL;
4692 PyObject *__pyx_t_2 = NULL;
4693 PyObject *__pyx_t_3 = NULL;
4694 PyObject *__pyx_t_4 = NULL;
4695 int __pyx_lineno = 0;
4696 const char *__pyx_filename = NULL;
4697 int __pyx_clineno = 0;
4698 __Pyx_TraceFrameInit(__pyx_codeobj__5)
4699 __Pyx_RefNannySetupContext(
"resetBC", 0);
4700 __Pyx_TraceCall(
"resetBC", __pyx_f[0], 84, 0, __PYX_ERR(0, 84, __pyx_L1_error));
4702 if (unlikely(__pyx_skip_dispatch)) ;
4704 else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
4705 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
4706 static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
4707 if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
4708 PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
4710 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_resetBC);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error)
4711 __Pyx_GOTREF(__pyx_t_1);
4712 if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(
void*)__pyx_pw_18BoundaryConditions_17BoundaryCondition_5resetBC)) {
4713 __Pyx_INCREF(__pyx_t_1);
4714 __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
4715 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
4716 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
4717 if (likely(__pyx_t_4)) {
4718 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
4719 __Pyx_INCREF(__pyx_t_4);
4720 __Pyx_INCREF(
function);
4721 __Pyx_DECREF_SET(__pyx_t_3,
function);
4724 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
4725 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
4726 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 84, __pyx_L1_error)
4727 __Pyx_GOTREF(__pyx_t_2);
4728 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4729 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4730 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4733 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
4734 __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
4735 __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
4736 if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
4737 __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
4740 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4741 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
4753 __Pyx_INCREF(Py_None);
4754 __Pyx_GIVEREF(Py_None);
4755 __Pyx_GOTREF(__pyx_v_self->uOfXT);
4756 __Pyx_DECREF(__pyx_v_self->uOfXT);
4757 __pyx_v_self->uOfXT = Py_None;
4770 __Pyx_XDECREF(__pyx_t_1);
4771 __Pyx_XDECREF(__pyx_t_2);
4772 __Pyx_XDECREF(__pyx_t_3);
4773 __Pyx_XDECREF(__pyx_t_4);
4774 __Pyx_WriteUnraisable(
"BoundaryConditions.BoundaryCondition.resetBC", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
4776 __Pyx_TraceReturn(Py_None, 0);
4777 __Pyx_RefNannyFinishContext();
4781 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_5resetBC(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
4782 static char __pyx_doc_18BoundaryConditions_17BoundaryCondition_4resetBC[] =
"BoundaryCondition.resetBC(self) -> void";
4783 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_5resetBC = {
"resetBC", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_5resetBC, METH_NOARGS, __pyx_doc_18BoundaryConditions_17BoundaryCondition_4resetBC};
4784 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_5resetBC(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4785 PyObject *__pyx_r = 0;
4786 __Pyx_RefNannyDeclarations
4787 __Pyx_RefNannySetupContext(
"resetBC (wrapper)", 0);
4788 __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_4resetBC(((
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self));
4791 __Pyx_RefNannyFinishContext();
4795 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_4resetBC(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self) {
4796 PyObject *__pyx_r = NULL;
4797 __Pyx_TraceDeclarations
4798 __Pyx_RefNannyDeclarations
4799 PyObject *__pyx_t_1 = NULL;
4800 int __pyx_lineno = 0;
4801 const char *__pyx_filename = NULL;
4802 int __pyx_clineno = 0;
4803 __Pyx_TraceFrameInit(__pyx_codeobj__5)
4804 __Pyx_RefNannySetupContext(
"resetBC", 0);
4805 __Pyx_TraceCall(
"resetBC (wrapper)", __pyx_f[0], 84, 0, __PYX_ERR(0, 84, __pyx_L1_error));
4806 __Pyx_XDECREF(__pyx_r);
4807 __pyx_t_1 = __Pyx_void_to_None(__pyx_f_18BoundaryConditions_17BoundaryCondition_resetBC(__pyx_v_self, 1));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error)
4808 __Pyx_GOTREF(__pyx_t_1);
4809 __pyx_r = __pyx_t_1;
4815 __Pyx_XDECREF(__pyx_t_1);
4816 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.resetBC", __pyx_clineno, __pyx_lineno, __pyx_filename);
4819 __Pyx_XGIVEREF(__pyx_r);
4820 __Pyx_TraceReturn(__pyx_r, 0);
4821 __Pyx_RefNannyFinishContext();
4834 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_7setConstantBC(PyObject *__pyx_v_self, PyObject *__pyx_v_value);
4835 static char __pyx_doc_18BoundaryConditions_17BoundaryCondition_6setConstantBC[] =
"BoundaryCondition.setConstantBC(self, value)\n\n function returning constant BC\n\n Parameters\n ----------\n value : float\n Constant value\n\n ";
4836 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_7setConstantBC = {
"setConstantBC", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_7setConstantBC, METH_O, __pyx_doc_18BoundaryConditions_17BoundaryCondition_6setConstantBC};
4837 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_7setConstantBC(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
4838 PyObject *__pyx_r = 0;
4839 __Pyx_RefNannyDeclarations
4840 __Pyx_RefNannySetupContext(
"setConstantBC (wrapper)", 0);
4841 __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_6setConstantBC(((
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self), ((PyObject *)__pyx_v_value));
4844 __Pyx_RefNannyFinishContext();
4856 static PyObject *__pyx_pf_18BoundaryConditions_2__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
4857 PyObject *__pyx_r = NULL;
4858 __Pyx_TraceDeclarations
4859 __Pyx_RefNannyDeclarations
4860 PyObject *__pyx_t_1 = NULL;
4861 PyObject *__pyx_t_2 = NULL;
4862 int __pyx_lineno = 0;
4863 const char *__pyx_filename = NULL;
4864 int __pyx_clineno = 0;
4865 __Pyx_RefNannySetupContext(
"__defaults__", 0);
4866 __Pyx_TraceCall(
"__defaults__", __pyx_f[0], 97, 0, __PYX_ERR(0, 97, __pyx_L1_error));
4867 __Pyx_XDECREF(__pyx_r);
4868 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error)
4869 __Pyx_GOTREF(__pyx_t_1);
4870 __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_n);
4871 __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_n);
4872 PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_n);
4873 __pyx_t_2 = PyTuple_New(2);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error)
4874 __Pyx_GOTREF(__pyx_t_2);
4875 __Pyx_GIVEREF(__pyx_t_1);
4876 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
4877 __Pyx_INCREF(Py_None);
4878 __Pyx_GIVEREF(Py_None);
4879 PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
4881 __pyx_r = __pyx_t_2;
4887 __Pyx_XDECREF(__pyx_t_1);
4888 __Pyx_XDECREF(__pyx_t_2);
4889 __Pyx_AddTraceback(
"BoundaryConditions.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4892 __Pyx_XGIVEREF(__pyx_r);
4893 __Pyx_TraceReturn(__pyx_r, 0);
4894 __Pyx_RefNannyFinishContext();
4899 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_13setConstantBC_lambda(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
4900 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_13setConstantBC_lambda = {
"lambda", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_18BoundaryConditions_17BoundaryCondition_13setConstantBC_lambda, METH_VARARGS|METH_KEYWORDS, 0};
4901 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_13setConstantBC_lambda(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4902 CYTHON_UNUSED PyObject *__pyx_v_x = 0;
4903 CYTHON_UNUSED PyObject *__pyx_v_t = 0;
4904 CYTHON_UNUSED PyObject *__pyx_v_n = 0;
4905 int __pyx_lineno = 0;
4906 const char *__pyx_filename = NULL;
4907 int __pyx_clineno = 0;
4908 PyObject *__pyx_r = 0;
4909 __Pyx_RefNannyDeclarations
4910 __Pyx_RefNannySetupContext(
"lambda (wrapper)", 0);
4912 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_t,&__pyx_n_s_n,0};
4913 PyObject* values[3] = {0,0,0};
4914 __pyx_defaults *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self);
4915 values[2] = __pyx_dynamic_args->__pyx_arg_n;
4916 if (unlikely(__pyx_kwds)) {
4918 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4920 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4922 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4924 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4927 default:
goto __pyx_L5_argtuple_error;
4929 kw_args = PyDict_Size(__pyx_kwds);
4932 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
4933 else goto __pyx_L5_argtuple_error;
4936 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
4938 __Pyx_RaiseArgtupleInvalid(
"lambda", 0, 2, 3, 1); __PYX_ERR(0, 97, __pyx_L3_error)
4943 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n);
4944 if (value) { values[2] = value; kw_args--; }
4947 if (unlikely(kw_args > 0)) {
4948 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"lambda") < 0)) __PYX_ERR(0, 97, __pyx_L3_error)
4951 switch (PyTuple_GET_SIZE(__pyx_args)) {
4952 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4954 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4955 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4957 default:
goto __pyx_L5_argtuple_error;
4960 __pyx_v_x = values[0];
4961 __pyx_v_t = values[1];
4962 __pyx_v_n = values[2];
4964 goto __pyx_L4_argument_unpacking_done;
4965 __pyx_L5_argtuple_error:;
4966 __Pyx_RaiseArgtupleInvalid(
"lambda", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 97, __pyx_L3_error)
4968 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.setConstantBC.lambda", __pyx_clineno, __pyx_lineno, __pyx_filename);
4969 __Pyx_RefNannyFinishContext();
4971 __pyx_L4_argument_unpacking_done:;
4972 __pyx_r = __pyx_lambda_funcdef_lambda(__pyx_self, __pyx_v_x, __pyx_v_t, __pyx_v_n);
4975 __Pyx_RefNannyFinishContext();
4979 static PyObject *__pyx_lambda_funcdef_lambda(PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *__pyx_v_t, CYTHON_UNUSED PyObject *__pyx_v_n) {
4980 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *__pyx_cur_scope;
4981 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *__pyx_outer_scope;
4982 PyObject *__pyx_r = NULL;
4983 __Pyx_TraceDeclarations
4984 __Pyx_RefNannyDeclarations
4985 int __pyx_lineno = 0;
4986 const char *__pyx_filename = NULL;
4987 int __pyx_clineno = 0;
4988 __Pyx_RefNannySetupContext(
"lambda", 0);
4989 __pyx_outer_scope = (
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *) __Pyx_CyFunction_GetClosure(__pyx_self);
4990 __pyx_cur_scope = __pyx_outer_scope;
4991 __Pyx_TraceCall(
"lambda", __pyx_f[0], 97, 0, __PYX_ERR(0, 97, __pyx_L1_error));
4992 __Pyx_XDECREF(__pyx_r);
4993 if (unlikely(!__pyx_cur_scope->__pyx_v_value)) { __Pyx_RaiseClosureNameError(
"value"); __PYX_ERR(0, 97, __pyx_L1_error) }
4994 __Pyx_INCREF(__pyx_cur_scope->__pyx_v_value);
4995 __pyx_r = __pyx_cur_scope->__pyx_v_value;
5000 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.setConstantBC.lambda", __pyx_clineno, __pyx_lineno, __pyx_filename);
5003 __Pyx_XGIVEREF(__pyx_r);
5004 __Pyx_TraceReturn(__pyx_r, 0);
5005 __Pyx_RefNannyFinishContext();
5017 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_6setConstantBC(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_value) {
5018 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *__pyx_cur_scope;
5019 PyObject *__pyx_r = NULL;
5020 __Pyx_TraceDeclarations
5021 __Pyx_RefNannyDeclarations
5022 PyObject *__pyx_t_1 = NULL;
5023 PyObject *__pyx_t_2 = NULL;
5024 PyObject *__pyx_t_3 = NULL;
5025 PyObject *__pyx_t_4 = NULL;
5026 int __pyx_lineno = 0;
5027 const char *__pyx_filename = NULL;
5028 int __pyx_clineno = 0;
5029 __Pyx_TraceFrameInit(__pyx_codeobj__6)
5030 __Pyx_RefNannySetupContext(
"setConstantBC", 0);
5031 __pyx_cur_scope = (
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *)__pyx_tp_new_18BoundaryConditions___pyx_scope_struct__setConstantBC(__pyx_ptype_18BoundaryConditions___pyx_scope_struct__setConstantBC, __pyx_empty_tuple, NULL);
5032 if (unlikely(!__pyx_cur_scope)) {
5033 __pyx_cur_scope = ((
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *)Py_None);
5034 __Pyx_INCREF(Py_None);
5035 __PYX_ERR(0, 87, __pyx_L1_error)
5037 __Pyx_GOTREF(__pyx_cur_scope);
5039 __Pyx_TraceCall(
"setConstantBC", __pyx_f[0], 87, 0, __PYX_ERR(0, 87, __pyx_L1_error));
5040 __pyx_cur_scope->__pyx_v_value = __pyx_v_value;
5041 __Pyx_INCREF(__pyx_cur_scope->__pyx_v_value);
5042 __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_value);
5051 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_13setConstantBC_lambda, 0, __pyx_n_s_setConstantBC_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_BoundaryConditions, __pyx_d, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error)
5052 __Pyx_GOTREF(__pyx_t_1);
5053 if (!__Pyx_CyFunction_InitDefaults(__pyx_t_1,
sizeof(__pyx_defaults), 1)) __PYX_ERR(0, 97, __pyx_L1_error)
5054 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 97, __pyx_L1_error)
5055 __Pyx_GOTREF(__pyx_t_3);
5056 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 97, __pyx_L1_error)
5057 __Pyx_GOTREF(__pyx_t_4);
5058 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5060 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
5061 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
5062 if (likely(__pyx_t_3)) {
5063 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
5064 __Pyx_INCREF(__pyx_t_3);
5065 __Pyx_INCREF(
function);
5066 __Pyx_DECREF_SET(__pyx_t_4,
function);
5069 __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_int_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_int_3);
5070 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5071 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error)
5072 __Pyx_GOTREF(__pyx_t_2);
5073 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5074 __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_1)->__pyx_arg_n = __pyx_t_2;
5075 __Pyx_GIVEREF(__pyx_t_2);
5077 __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_1, __pyx_pf_18BoundaryConditions_2__defaults__);
5078 __Pyx_GIVEREF(__pyx_t_1);
5079 __Pyx_GOTREF(__pyx_v_self->uOfXT);
5080 __Pyx_DECREF(__pyx_v_self->uOfXT);
5081 __pyx_v_self->uOfXT = __pyx_t_1;
5093 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5096 __Pyx_XDECREF(__pyx_t_1);
5097 __Pyx_XDECREF(__pyx_t_2);
5098 __Pyx_XDECREF(__pyx_t_3);
5099 __Pyx_XDECREF(__pyx_t_4);
5100 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.setConstantBC", __pyx_clineno, __pyx_lineno, __pyx_filename);
5103 __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
5104 __Pyx_XGIVEREF(__pyx_r);
5105 __Pyx_TraceReturn(__pyx_r, 0);
5106 __Pyx_RefNannyFinishContext();
5119 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_9setLinearBC(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5120 static char __pyx_doc_18BoundaryConditions_17BoundaryCondition_8setLinearBC[] =
"BoundaryCondition.setLinearBC(self, a0, a)\n\n function returning value=a0+ax*x+ay*y+az*z\n\n Parameters\n ----------\n a0 : float\n constant\n a: numpy.ndarray\n ax,ay,az\n\n ";
5121 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_9setLinearBC = {
"setLinearBC", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_18BoundaryConditions_17BoundaryCondition_9setLinearBC, METH_VARARGS|METH_KEYWORDS, __pyx_doc_18BoundaryConditions_17BoundaryCondition_8setLinearBC};
5122 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_9setLinearBC(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5123 PyObject *__pyx_v_a0 = 0;
5124 PyObject *__pyx_v_a = 0;
5125 int __pyx_lineno = 0;
5126 const char *__pyx_filename = NULL;
5127 int __pyx_clineno = 0;
5128 PyObject *__pyx_r = 0;
5129 __Pyx_RefNannyDeclarations
5130 __Pyx_RefNannySetupContext(
"setLinearBC (wrapper)", 0);
5132 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a0,&__pyx_n_s_a,0};
5133 PyObject* values[2] = {0,0};
5134 if (unlikely(__pyx_kwds)) {
5136 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5138 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5140 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5143 default:
goto __pyx_L5_argtuple_error;
5145 kw_args = PyDict_Size(__pyx_kwds);
5148 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_a0)) != 0)) kw_args--;
5149 else goto __pyx_L5_argtuple_error;
5152 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--;
5154 __Pyx_RaiseArgtupleInvalid(
"setLinearBC", 1, 2, 2, 1); __PYX_ERR(0, 100, __pyx_L3_error)
5157 if (unlikely(kw_args > 0)) {
5158 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"setLinearBC") < 0)) __PYX_ERR(0, 100, __pyx_L3_error)
5160 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
5161 goto __pyx_L5_argtuple_error;
5163 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5164 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5166 __pyx_v_a0 = values[0];
5167 __pyx_v_a = values[1];
5169 goto __pyx_L4_argument_unpacking_done;
5170 __pyx_L5_argtuple_error:;
5171 __Pyx_RaiseArgtupleInvalid(
"setLinearBC", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 100, __pyx_L3_error)
5173 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.setLinearBC", __pyx_clineno, __pyx_lineno, __pyx_filename);
5174 __Pyx_RefNannyFinishContext();
5176 __pyx_L4_argument_unpacking_done:;
5177 __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_8setLinearBC(((
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self), __pyx_v_a0, __pyx_v_a);
5180 __Pyx_RefNannyFinishContext();
5192 static PyObject *__pyx_pf_18BoundaryConditions_4__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
5193 PyObject *__pyx_r = NULL;
5194 __Pyx_TraceDeclarations
5195 __Pyx_RefNannyDeclarations
5196 PyObject *__pyx_t_1 = NULL;
5197 PyObject *__pyx_t_2 = NULL;
5198 int __pyx_lineno = 0;
5199 const char *__pyx_filename = NULL;
5200 int __pyx_clineno = 0;
5201 __Pyx_RefNannySetupContext(
"__defaults__", 0);
5202 __Pyx_TraceCall(
"__defaults__", __pyx_f[0], 113, 0, __PYX_ERR(0, 113, __pyx_L1_error));
5203 __Pyx_XDECREF(__pyx_r);
5204 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 113, __pyx_L1_error)
5205 __Pyx_GOTREF(__pyx_t_1);
5206 __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_n);
5207 __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_n);
5208 PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_n);
5209 __pyx_t_2 = PyTuple_New(2);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 113, __pyx_L1_error)
5210 __Pyx_GOTREF(__pyx_t_2);
5211 __Pyx_GIVEREF(__pyx_t_1);
5212 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
5213 __Pyx_INCREF(Py_None);
5214 __Pyx_GIVEREF(Py_None);
5215 PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
5217 __pyx_r = __pyx_t_2;
5223 __Pyx_XDECREF(__pyx_t_1);
5224 __Pyx_XDECREF(__pyx_t_2);
5225 __Pyx_AddTraceback(
"BoundaryConditions.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5228 __Pyx_XGIVEREF(__pyx_r);
5229 __Pyx_TraceReturn(__pyx_r, 0);
5230 __Pyx_RefNannyFinishContext();
5235 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_11setLinearBC_lambda1(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5236 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_11setLinearBC_lambda1 = {
"lambda1", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_18BoundaryConditions_17BoundaryCondition_11setLinearBC_lambda1, METH_VARARGS|METH_KEYWORDS, 0};
5237 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_11setLinearBC_lambda1(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5238 PyObject *__pyx_v_x = 0;
5239 CYTHON_UNUSED PyObject *__pyx_v_t = 0;
5240 CYTHON_UNUSED PyObject *__pyx_v_n = 0;
5241 int __pyx_lineno = 0;
5242 const char *__pyx_filename = NULL;
5243 int __pyx_clineno = 0;
5244 PyObject *__pyx_r = 0;
5245 __Pyx_RefNannyDeclarations
5246 __Pyx_RefNannySetupContext(
"lambda1 (wrapper)", 0);
5248 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_t,&__pyx_n_s_n,0};
5249 PyObject* values[3] = {0,0,0};
5250 __pyx_defaults1 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self);
5251 values[2] = __pyx_dynamic_args->__pyx_arg_n;
5252 if (unlikely(__pyx_kwds)) {
5254 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5256 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5258 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5260 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5263 default:
goto __pyx_L5_argtuple_error;
5265 kw_args = PyDict_Size(__pyx_kwds);
5268 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
5269 else goto __pyx_L5_argtuple_error;
5272 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
5274 __Pyx_RaiseArgtupleInvalid(
"lambda1", 0, 2, 3, 1); __PYX_ERR(0, 113, __pyx_L3_error)
5279 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n);
5280 if (value) { values[2] = value; kw_args--; }
5283 if (unlikely(kw_args > 0)) {
5284 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"lambda1") < 0)) __PYX_ERR(0, 113, __pyx_L3_error)
5287 switch (PyTuple_GET_SIZE(__pyx_args)) {
5288 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5290 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5291 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5293 default:
goto __pyx_L5_argtuple_error;
5296 __pyx_v_x = values[0];
5297 __pyx_v_t = values[1];
5298 __pyx_v_n = values[2];
5300 goto __pyx_L4_argument_unpacking_done;
5301 __pyx_L5_argtuple_error:;
5302 __Pyx_RaiseArgtupleInvalid(
"lambda1", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 113, __pyx_L3_error)
5304 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.setLinearBC.lambda1", __pyx_clineno, __pyx_lineno, __pyx_filename);
5305 __Pyx_RefNannyFinishContext();
5307 __pyx_L4_argument_unpacking_done:;
5308 __pyx_r = __pyx_lambda_funcdef_lambda1(__pyx_self, __pyx_v_x, __pyx_v_t, __pyx_v_n);
5311 __Pyx_RefNannyFinishContext();
5315 static PyObject *__pyx_lambda_funcdef_lambda1(PyObject *__pyx_self, PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *__pyx_v_t, CYTHON_UNUSED PyObject *__pyx_v_n) {
5316 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *__pyx_cur_scope;
5317 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *__pyx_outer_scope;
5318 PyObject *__pyx_r = NULL;
5319 __Pyx_TraceDeclarations
5320 __Pyx_RefNannyDeclarations
5321 PyObject *__pyx_t_1 = NULL;
5322 PyObject *__pyx_t_2 = NULL;
5323 PyObject *__pyx_t_3 = NULL;
5324 int __pyx_lineno = 0;
5325 const char *__pyx_filename = NULL;
5326 int __pyx_clineno = 0;
5327 __Pyx_RefNannySetupContext(
"lambda1", 0);
5328 __pyx_outer_scope = (
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *) __Pyx_CyFunction_GetClosure(__pyx_self);
5329 __pyx_cur_scope = __pyx_outer_scope;
5330 __Pyx_TraceCall(
"lambda1", __pyx_f[0], 113, 0, __PYX_ERR(0, 113, __pyx_L1_error));
5331 __Pyx_XDECREF(__pyx_r);
5332 if (unlikely(!__pyx_cur_scope->__pyx_v_a0)) { __Pyx_RaiseClosureNameError(
"a0"); __PYX_ERR(0, 113, __pyx_L1_error) }
5333 if (unlikely(!__pyx_cur_scope->__pyx_v_a)) { __Pyx_RaiseClosureNameError(
"a"); __PYX_ERR(0, 113, __pyx_L1_error) }
5334 __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_cur_scope->__pyx_v_a, 0, 0, NULL, NULL, &__pyx_slice__7, 0, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 113, __pyx_L1_error)
5335 __Pyx_GOTREF(__pyx_t_1);
5336 __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_x, 0, 0, NULL, NULL, &__pyx_slice__7, 0, 0, 0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 113, __pyx_L1_error)
5337 __Pyx_GOTREF(__pyx_t_2);
5338 __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 113, __pyx_L1_error)
5339 __Pyx_GOTREF(__pyx_t_3);
5340 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5341 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5342 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 113, __pyx_L1_error)
5343 __Pyx_GOTREF(__pyx_t_2);
5344 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5345 __pyx_t_3 = PyNumber_Add(__pyx_cur_scope->__pyx_v_a0, __pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 113, __pyx_L1_error)
5346 __Pyx_GOTREF(__pyx_t_3);
5347 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5348 __pyx_r = __pyx_t_3;
5354 __Pyx_XDECREF(__pyx_t_1);
5355 __Pyx_XDECREF(__pyx_t_2);
5356 __Pyx_XDECREF(__pyx_t_3);
5357 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.setLinearBC.lambda1", __pyx_clineno, __pyx_lineno, __pyx_filename);
5360 __Pyx_XGIVEREF(__pyx_r);
5361 __Pyx_TraceReturn(__pyx_r, 0);
5362 __Pyx_RefNannyFinishContext();
5374 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_8setLinearBC(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_a0, PyObject *__pyx_v_a) {
5375 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *__pyx_cur_scope;
5376 PyObject *__pyx_r = NULL;
5377 __Pyx_TraceDeclarations
5378 __Pyx_RefNannyDeclarations
5379 PyObject *__pyx_t_1 = NULL;
5380 PyObject *__pyx_t_2 = NULL;
5381 PyObject *__pyx_t_3 = NULL;
5382 PyObject *__pyx_t_4 = NULL;
5383 int __pyx_lineno = 0;
5384 const char *__pyx_filename = NULL;
5385 int __pyx_clineno = 0;
5386 __Pyx_TraceFrameInit(__pyx_codeobj__8)
5387 __Pyx_RefNannySetupContext(
"setLinearBC", 0);
5388 __pyx_cur_scope = (
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *)__pyx_tp_new_18BoundaryConditions___pyx_scope_struct_1_setLinearBC(__pyx_ptype_18BoundaryConditions___pyx_scope_struct_1_setLinearBC, __pyx_empty_tuple, NULL);
5389 if (unlikely(!__pyx_cur_scope)) {
5390 __pyx_cur_scope = ((
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *)Py_None);
5391 __Pyx_INCREF(Py_None);
5392 __PYX_ERR(0, 100, __pyx_L1_error)
5394 __Pyx_GOTREF(__pyx_cur_scope);
5396 __Pyx_TraceCall(
"setLinearBC", __pyx_f[0], 100, 0, __PYX_ERR(0, 100, __pyx_L1_error));
5397 __pyx_cur_scope->__pyx_v_a0 = __pyx_v_a0;
5398 __Pyx_INCREF(__pyx_cur_scope->__pyx_v_a0);
5399 __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_a0);
5400 __pyx_cur_scope->__pyx_v_a = __pyx_v_a;
5401 __Pyx_INCREF(__pyx_cur_scope->__pyx_v_a);
5402 __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_a);
5411 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_11setLinearBC_lambda1, 0, __pyx_n_s_setLinearBC_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_BoundaryConditions, __pyx_d, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 113, __pyx_L1_error)
5412 __Pyx_GOTREF(__pyx_t_1);
5413 if (!__Pyx_CyFunction_InitDefaults(__pyx_t_1,
sizeof(__pyx_defaults1), 1)) __PYX_ERR(0, 113, __pyx_L1_error)
5414 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 113, __pyx_L1_error)
5415 __Pyx_GOTREF(__pyx_t_3);
5416 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 113, __pyx_L1_error)
5417 __Pyx_GOTREF(__pyx_t_4);
5418 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5420 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
5421 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
5422 if (likely(__pyx_t_3)) {
5423 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
5424 __Pyx_INCREF(__pyx_t_3);
5425 __Pyx_INCREF(
function);
5426 __Pyx_DECREF_SET(__pyx_t_4,
function);
5429 __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_int_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_int_3);
5430 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5431 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 113, __pyx_L1_error)
5432 __Pyx_GOTREF(__pyx_t_2);
5433 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5434 __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_t_1)->__pyx_arg_n = __pyx_t_2;
5435 __Pyx_GIVEREF(__pyx_t_2);
5437 __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_1, __pyx_pf_18BoundaryConditions_4__defaults__);
5438 __Pyx_GIVEREF(__pyx_t_1);
5439 __Pyx_GOTREF(__pyx_v_self->uOfXT);
5440 __Pyx_DECREF(__pyx_v_self->uOfXT);
5441 __pyx_v_self->uOfXT = __pyx_t_1;
5453 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5456 __Pyx_XDECREF(__pyx_t_1);
5457 __Pyx_XDECREF(__pyx_t_2);
5458 __Pyx_XDECREF(__pyx_t_3);
5459 __Pyx_XDECREF(__pyx_t_4);
5460 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.setLinearBC", __pyx_clineno, __pyx_lineno, __pyx_filename);
5463 __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
5464 __Pyx_XGIVEREF(__pyx_r);
5465 __Pyx_TraceReturn(__pyx_r, 0);
5466 __Pyx_RefNannyFinishContext();
5479 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_11setLinearRamp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5480 static char __pyx_doc_18BoundaryConditions_17BoundaryCondition_10setLinearRamp[] =
"BoundaryCondition.setLinearRamp(self, t1, value)\n\n function setting a linear ramp from t=0 to t=t1\n\n Parameters\n -----------\n t1: float\n Ramp end time\n value: float\n Variable value\n ";
5481 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_11setLinearRamp = {
"setLinearRamp", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_18BoundaryConditions_17BoundaryCondition_11setLinearRamp, METH_VARARGS|METH_KEYWORDS, __pyx_doc_18BoundaryConditions_17BoundaryCondition_10setLinearRamp};
5482 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_11setLinearRamp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5483 PyObject *__pyx_v_t1 = 0;
5484 PyObject *__pyx_v_value = 0;
5485 int __pyx_lineno = 0;
5486 const char *__pyx_filename = NULL;
5487 int __pyx_clineno = 0;
5488 PyObject *__pyx_r = 0;
5489 __Pyx_RefNannyDeclarations
5490 __Pyx_RefNannySetupContext(
"setLinearRamp (wrapper)", 0);
5492 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t1,&__pyx_n_s_value,0};
5493 PyObject* values[2] = {0,0};
5494 if (unlikely(__pyx_kwds)) {
5496 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5498 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5500 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5503 default:
goto __pyx_L5_argtuple_error;
5505 kw_args = PyDict_Size(__pyx_kwds);
5508 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t1)) != 0)) kw_args--;
5509 else goto __pyx_L5_argtuple_error;
5512 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
5514 __Pyx_RaiseArgtupleInvalid(
"setLinearRamp", 1, 2, 2, 1); __PYX_ERR(0, 115, __pyx_L3_error)
5517 if (unlikely(kw_args > 0)) {
5518 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"setLinearRamp") < 0)) __PYX_ERR(0, 115, __pyx_L3_error)
5520 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
5521 goto __pyx_L5_argtuple_error;
5523 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5524 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5526 __pyx_v_t1 = values[0];
5527 __pyx_v_value = values[1];
5529 goto __pyx_L4_argument_unpacking_done;
5530 __pyx_L5_argtuple_error:;
5531 __Pyx_RaiseArgtupleInvalid(
"setLinearRamp", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 115, __pyx_L3_error)
5533 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.setLinearRamp", __pyx_clineno, __pyx_lineno, __pyx_filename);
5534 __Pyx_RefNannyFinishContext();
5536 __pyx_L4_argument_unpacking_done:;
5537 __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_10setLinearRamp(((
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self), __pyx_v_t1, __pyx_v_value);
5540 __Pyx_RefNannyFinishContext();
5550 static PyObject *__pyx_pf_18BoundaryConditions_6__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
5551 PyObject *__pyx_r = NULL;
5552 __Pyx_TraceDeclarations
5553 __Pyx_RefNannyDeclarations
5554 PyObject *__pyx_t_1 = NULL;
5555 PyObject *__pyx_t_2 = NULL;
5556 int __pyx_lineno = 0;
5557 const char *__pyx_filename = NULL;
5558 int __pyx_clineno = 0;
5559 __Pyx_RefNannySetupContext(
"__defaults__", 0);
5560 __Pyx_TraceCall(
"__defaults__", __pyx_f[0], 126, 0, __PYX_ERR(0, 126, __pyx_L1_error));
5561 __Pyx_XDECREF(__pyx_r);
5562 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 126, __pyx_L1_error)
5563 __Pyx_GOTREF(__pyx_t_1);
5564 __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self)->__pyx_arg_n);
5565 __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self)->__pyx_arg_n);
5566 PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self)->__pyx_arg_n);
5567 __pyx_t_2 = PyTuple_New(2);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error)
5568 __Pyx_GOTREF(__pyx_t_2);
5569 __Pyx_GIVEREF(__pyx_t_1);
5570 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
5571 __Pyx_INCREF(Py_None);
5572 __Pyx_GIVEREF(Py_None);
5573 PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
5575 __pyx_r = __pyx_t_2;
5581 __Pyx_XDECREF(__pyx_t_1);
5582 __Pyx_XDECREF(__pyx_t_2);
5583 __Pyx_AddTraceback(
"BoundaryConditions.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5586 __Pyx_XGIVEREF(__pyx_r);
5587 __Pyx_TraceReturn(__pyx_r, 0);
5588 __Pyx_RefNannyFinishContext();
5593 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_13setLinearRamp_lambda2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5594 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_13setLinearRamp_lambda2 = {
"lambda2", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_18BoundaryConditions_17BoundaryCondition_13setLinearRamp_lambda2, METH_VARARGS|METH_KEYWORDS, 0};
5595 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_13setLinearRamp_lambda2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5596 CYTHON_UNUSED PyObject *__pyx_v_x = 0;
5597 PyObject *__pyx_v_t = 0;
5598 CYTHON_UNUSED PyObject *__pyx_v_n = 0;
5599 int __pyx_lineno = 0;
5600 const char *__pyx_filename = NULL;
5601 int __pyx_clineno = 0;
5602 PyObject *__pyx_r = 0;
5603 __Pyx_RefNannyDeclarations
5604 __Pyx_RefNannySetupContext(
"lambda2 (wrapper)", 0);
5606 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_t,&__pyx_n_s_n,0};
5607 PyObject* values[3] = {0,0,0};
5608 __pyx_defaults2 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self);
5609 values[2] = __pyx_dynamic_args->__pyx_arg_n;
5610 if (unlikely(__pyx_kwds)) {
5612 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5614 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5616 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5618 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5621 default:
goto __pyx_L5_argtuple_error;
5623 kw_args = PyDict_Size(__pyx_kwds);
5626 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
5627 else goto __pyx_L5_argtuple_error;
5630 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
5632 __Pyx_RaiseArgtupleInvalid(
"lambda2", 0, 2, 3, 1); __PYX_ERR(0, 126, __pyx_L3_error)
5637 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n);
5638 if (value) { values[2] = value; kw_args--; }
5641 if (unlikely(kw_args > 0)) {
5642 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"lambda2") < 0)) __PYX_ERR(0, 126, __pyx_L3_error)
5645 switch (PyTuple_GET_SIZE(__pyx_args)) {
5646 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5648 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5649 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5651 default:
goto __pyx_L5_argtuple_error;
5654 __pyx_v_x = values[0];
5655 __pyx_v_t = values[1];
5656 __pyx_v_n = values[2];
5658 goto __pyx_L4_argument_unpacking_done;
5659 __pyx_L5_argtuple_error:;
5660 __Pyx_RaiseArgtupleInvalid(
"lambda2", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 126, __pyx_L3_error)
5662 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.setLinearRamp.lambda2", __pyx_clineno, __pyx_lineno, __pyx_filename);
5663 __Pyx_RefNannyFinishContext();
5665 __pyx_L4_argument_unpacking_done:;
5666 __pyx_r = __pyx_lambda_funcdef_lambda2(__pyx_self, __pyx_v_x, __pyx_v_t, __pyx_v_n);
5669 __Pyx_RefNannyFinishContext();
5673 static PyObject *__pyx_lambda_funcdef_lambda2(PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_x, PyObject *__pyx_v_t, CYTHON_UNUSED PyObject *__pyx_v_n) {
5674 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *__pyx_cur_scope;
5675 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *__pyx_outer_scope;
5676 PyObject *__pyx_r = NULL;
5677 __Pyx_TraceDeclarations
5678 __Pyx_RefNannyDeclarations
5680 PyObject *__pyx_t_2 = NULL;
5681 PyObject *__pyx_t_3 = NULL;
5682 PyObject *__pyx_t_4 = NULL;
5683 PyObject *__pyx_t_5 = NULL;
5685 int __pyx_lineno = 0;
5686 const char *__pyx_filename = NULL;
5687 int __pyx_clineno = 0;
5688 __Pyx_RefNannySetupContext(
"lambda2", 0);
5689 __pyx_outer_scope = (
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *) __Pyx_CyFunction_GetClosure(__pyx_self);
5690 __pyx_cur_scope = __pyx_outer_scope;
5691 __Pyx_TraceCall(
"lambda2", __pyx_f[0], 126, 0, __PYX_ERR(0, 126, __pyx_L1_error));
5692 __Pyx_XDECREF(__pyx_r);
5694 if (unlikely(!__pyx_cur_scope->__pyx_v_t1)) { __Pyx_RaiseClosureNameError(
"t1"); __PYX_ERR(0, 126, __pyx_L1_error) }
5695 __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_v_t, __pyx_cur_scope->__pyx_v_t1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error)
5696 __Pyx_GOTREF(__pyx_t_2);
5697 __pyx_t_4 = __Pyx_PyInt_From_long(__pyx_t_1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 126, __pyx_L1_error)
5698 __Pyx_GOTREF(__pyx_t_4);
5699 __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_5);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 126, __pyx_L1_error)
5700 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5701 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 126, __pyx_L1_error)
5702 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5704 __pyx_t_5 = __Pyx_PyInt_From_long(__pyx_t_1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 126, __pyx_L1_error)
5705 __Pyx_GOTREF(__pyx_t_5);
5706 __pyx_t_3 = __pyx_t_5;
5709 __Pyx_INCREF(__pyx_t_2);
5710 __pyx_t_3 = __pyx_t_2;
5712 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5713 if (unlikely(!__pyx_cur_scope->__pyx_v_value)) { __Pyx_RaiseClosureNameError(
"value"); __PYX_ERR(0, 126, __pyx_L1_error) }
5714 __pyx_t_2 = PyNumber_Multiply(__pyx_t_3, __pyx_cur_scope->__pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error)
5715 __Pyx_GOTREF(__pyx_t_2);
5716 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5717 __pyx_r = __pyx_t_2;
5723 __Pyx_XDECREF(__pyx_t_2);
5724 __Pyx_XDECREF(__pyx_t_3);
5725 __Pyx_XDECREF(__pyx_t_4);
5726 __Pyx_XDECREF(__pyx_t_5);
5727 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.setLinearRamp.lambda2", __pyx_clineno, __pyx_lineno, __pyx_filename);
5730 __Pyx_XGIVEREF(__pyx_r);
5731 __Pyx_TraceReturn(__pyx_r, 0);
5732 __Pyx_RefNannyFinishContext();
5744 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_10setLinearRamp(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_t1, PyObject *__pyx_v_value) {
5745 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *__pyx_cur_scope;
5746 PyObject *__pyx_r = NULL;
5747 __Pyx_TraceDeclarations
5748 __Pyx_RefNannyDeclarations
5749 PyObject *__pyx_t_1 = NULL;
5750 PyObject *__pyx_t_2 = NULL;
5751 PyObject *__pyx_t_3 = NULL;
5752 PyObject *__pyx_t_4 = NULL;
5753 int __pyx_lineno = 0;
5754 const char *__pyx_filename = NULL;
5755 int __pyx_clineno = 0;
5756 __Pyx_TraceFrameInit(__pyx_codeobj__9)
5757 __Pyx_RefNannySetupContext(
"setLinearRamp", 0);
5758 __pyx_cur_scope = (
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *)__pyx_tp_new_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp(__pyx_ptype_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp, __pyx_empty_tuple, NULL);
5759 if (unlikely(!__pyx_cur_scope)) {
5760 __pyx_cur_scope = ((
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *)Py_None);
5761 __Pyx_INCREF(Py_None);
5762 __PYX_ERR(0, 115, __pyx_L1_error)
5764 __Pyx_GOTREF(__pyx_cur_scope);
5766 __Pyx_TraceCall(
"setLinearRamp", __pyx_f[0], 115, 0, __PYX_ERR(0, 115, __pyx_L1_error));
5767 __pyx_cur_scope->__pyx_v_t1 = __pyx_v_t1;
5768 __Pyx_INCREF(__pyx_cur_scope->__pyx_v_t1);
5769 __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_t1);
5770 __pyx_cur_scope->__pyx_v_value = __pyx_v_value;
5771 __Pyx_INCREF(__pyx_cur_scope->__pyx_v_value);
5772 __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_value);
5779 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_13setLinearRamp_lambda2, 0, __pyx_n_s_setLinearRamp_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_BoundaryConditions, __pyx_d, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 126, __pyx_L1_error)
5780 __Pyx_GOTREF(__pyx_t_1);
5781 if (!__Pyx_CyFunction_InitDefaults(__pyx_t_1,
sizeof(__pyx_defaults2), 1)) __PYX_ERR(0, 126, __pyx_L1_error)
5782 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 126, __pyx_L1_error)
5783 __Pyx_GOTREF(__pyx_t_3);
5784 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 126, __pyx_L1_error)
5785 __Pyx_GOTREF(__pyx_t_4);
5786 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5788 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
5789 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
5790 if (likely(__pyx_t_3)) {
5791 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
5792 __Pyx_INCREF(__pyx_t_3);
5793 __Pyx_INCREF(
function);
5794 __Pyx_DECREF_SET(__pyx_t_4,
function);
5797 __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_int_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_int_3);
5798 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5799 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error)
5800 __Pyx_GOTREF(__pyx_t_2);
5801 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5802 __Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_t_1)->__pyx_arg_n = __pyx_t_2;
5803 __Pyx_GIVEREF(__pyx_t_2);
5805 __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_1, __pyx_pf_18BoundaryConditions_6__defaults__);
5806 __Pyx_GIVEREF(__pyx_t_1);
5807 __Pyx_GOTREF(__pyx_v_self->uOfXT);
5808 __Pyx_DECREF(__pyx_v_self->uOfXT);
5809 __pyx_v_self->uOfXT = __pyx_t_1;
5821 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5824 __Pyx_XDECREF(__pyx_t_1);
5825 __Pyx_XDECREF(__pyx_t_2);
5826 __Pyx_XDECREF(__pyx_t_3);
5827 __Pyx_XDECREF(__pyx_t_4);
5828 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.setLinearRamp", __pyx_clineno, __pyx_lineno, __pyx_filename);
5831 __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
5832 __Pyx_XGIVEREF(__pyx_r);
5833 __Pyx_TraceReturn(__pyx_r, 0);
5834 __Pyx_RefNannyFinishContext();
5847 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_1__get__(PyObject *__pyx_v_self);
5848 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_1__get__(PyObject *__pyx_v_self) {
5849 PyObject *__pyx_r = 0;
5850 __Pyx_RefNannyDeclarations
5851 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
5852 __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT___get__(((
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self));
5855 __Pyx_RefNannyFinishContext();
5859 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT___get__(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self) {
5860 PyObject *__pyx_r = NULL;
5861 __Pyx_TraceDeclarations
5862 __Pyx_RefNannyDeclarations
5863 int __pyx_lineno = 0;
5864 const char *__pyx_filename = NULL;
5865 int __pyx_clineno = 0;
5866 __Pyx_RefNannySetupContext(
"__get__", 0);
5867 __Pyx_TraceCall(
"__get__", __pyx_f[2], 20, 0, __PYX_ERR(2, 20, __pyx_L1_error));
5868 __Pyx_XDECREF(__pyx_r);
5869 __Pyx_INCREF(__pyx_v_self->uOfXT);
5870 __pyx_r = __pyx_v_self->uOfXT;
5875 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.uOfXT.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5878 __Pyx_XGIVEREF(__pyx_r);
5879 __Pyx_TraceReturn(__pyx_r, 0);
5880 __Pyx_RefNannyFinishContext();
5885 static int __pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value);
5886 static int __pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
5888 __Pyx_RefNannyDeclarations
5889 __Pyx_RefNannySetupContext(
"__set__ (wrapper)", 0);
5890 __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT_2__set__(((
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self), ((PyObject *)__pyx_v_value));
5893 __Pyx_RefNannyFinishContext();
5897 static int __pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT_2__set__(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_value) {
5899 __Pyx_TraceDeclarations
5900 __Pyx_RefNannyDeclarations
5901 int __pyx_lineno = 0;
5902 const char *__pyx_filename = NULL;
5903 int __pyx_clineno = 0;
5904 __Pyx_RefNannySetupContext(
"__set__", 0);
5905 __Pyx_TraceCall(
"__set__", __pyx_f[2], 20, 0, __PYX_ERR(2, 20, __pyx_L1_error));
5906 __Pyx_INCREF(__pyx_v_value);
5907 __Pyx_GIVEREF(__pyx_v_value);
5908 __Pyx_GOTREF(__pyx_v_self->uOfXT);
5909 __Pyx_DECREF(__pyx_v_self->uOfXT);
5910 __pyx_v_self->uOfXT = __pyx_v_value;
5916 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.uOfXT.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5919 __Pyx_TraceReturn(Py_None, 0);
5920 __Pyx_RefNannyFinishContext();
5925 static int __pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_5__del__(PyObject *__pyx_v_self);
5926 static int __pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_5__del__(PyObject *__pyx_v_self) {
5928 __Pyx_RefNannyDeclarations
5929 __Pyx_RefNannySetupContext(
"__del__ (wrapper)", 0);
5930 __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT_4__del__(((
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self));
5933 __Pyx_RefNannyFinishContext();
5937 static int __pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT_4__del__(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self) {
5939 __Pyx_TraceDeclarations
5940 __Pyx_RefNannyDeclarations
5941 int __pyx_lineno = 0;
5942 const char *__pyx_filename = NULL;
5943 int __pyx_clineno = 0;
5944 __Pyx_RefNannySetupContext(
"__del__", 0);
5945 __Pyx_TraceCall(
"__del__", __pyx_f[2], 20, 0, __PYX_ERR(2, 20, __pyx_L1_error));
5946 __Pyx_INCREF(Py_None);
5947 __Pyx_GIVEREF(Py_None);
5948 __Pyx_GOTREF(__pyx_v_self->uOfXT);
5949 __Pyx_DECREF(__pyx_v_self->uOfXT);
5950 __pyx_v_self->uOfXT = Py_None;
5956 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.uOfXT.__del__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5959 __Pyx_TraceReturn(Py_None, 0);
5960 __Pyx_RefNannyFinishContext();
5971 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_13__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
5972 static char __pyx_doc_18BoundaryConditions_17BoundaryCondition_12__reduce_cython__[] =
"BoundaryCondition.__reduce_cython__(self)";
5973 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_13__reduce_cython__ = {
"__reduce_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_13__reduce_cython__, METH_NOARGS, __pyx_doc_18BoundaryConditions_17BoundaryCondition_12__reduce_cython__};
5974 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_13__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5975 PyObject *__pyx_r = 0;
5976 __Pyx_RefNannyDeclarations
5977 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
5978 __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_12__reduce_cython__(((
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self));
5981 __Pyx_RefNannyFinishContext();
5985 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_12__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self) {
5986 PyObject *__pyx_r = NULL;
5987 __Pyx_TraceDeclarations
5988 __Pyx_RefNannyDeclarations
5989 PyObject *__pyx_t_1 = NULL;
5990 int __pyx_lineno = 0;
5991 const char *__pyx_filename = NULL;
5992 int __pyx_clineno = 0;
5993 __Pyx_TraceFrameInit(__pyx_codeobj__10)
5994 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
5995 __Pyx_TraceCall(
"__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
6003 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__11, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
6004 __Pyx_GOTREF(__pyx_t_1);
6005 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
6006 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6007 __PYX_ERR(1, 2, __pyx_L1_error)
6017 __Pyx_XDECREF(__pyx_t_1);
6018 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6020 __Pyx_XGIVEREF(__pyx_r);
6021 __Pyx_TraceReturn(__pyx_r, 0);
6022 __Pyx_RefNannyFinishContext();
6034 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_15__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
6035 static char __pyx_doc_18BoundaryConditions_17BoundaryCondition_14__setstate_cython__[] =
"BoundaryCondition.__setstate_cython__(self, __pyx_state)";
6036 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_15__setstate_cython__ = {
"__setstate_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_15__setstate_cython__, METH_O, __pyx_doc_18BoundaryConditions_17BoundaryCondition_14__setstate_cython__};
6037 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_15__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
6038 PyObject *__pyx_r = 0;
6039 __Pyx_RefNannyDeclarations
6040 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
6041 __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_14__setstate_cython__(((
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
6044 __Pyx_RefNannyFinishContext();
6048 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_14__setstate_cython__(CYTHON_UNUSED
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
6049 PyObject *__pyx_r = NULL;
6050 __Pyx_TraceDeclarations
6051 __Pyx_RefNannyDeclarations
6052 PyObject *__pyx_t_1 = NULL;
6053 int __pyx_lineno = 0;
6054 const char *__pyx_filename = NULL;
6055 int __pyx_clineno = 0;
6056 __Pyx_TraceFrameInit(__pyx_codeobj__12)
6057 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
6058 __Pyx_TraceCall(
"__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
6065 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__13, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
6066 __Pyx_GOTREF(__pyx_t_1);
6067 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
6068 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6069 __PYX_ERR(1, 4, __pyx_L1_error)
6080 __Pyx_XDECREF(__pyx_t_1);
6081 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6083 __Pyx_XGIVEREF(__pyx_r);
6084 __Pyx_TraceReturn(__pyx_r, 0);
6085 __Pyx_RefNannyFinishContext();
6096 static PyObject *__pyx_pw_18BoundaryConditions_1__pyx_unpickle_BC_Base(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
6097 static char __pyx_doc_18BoundaryConditions___pyx_unpickle_BC_Base[] =
"__pyx_unpickle_BC_Base(__pyx_type, long __pyx_checksum, __pyx_state)";
6098 static PyMethodDef __pyx_mdef_18BoundaryConditions_1__pyx_unpickle_BC_Base = {
"__pyx_unpickle_BC_Base", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_18BoundaryConditions_1__pyx_unpickle_BC_Base, METH_VARARGS|METH_KEYWORDS, __pyx_doc_18BoundaryConditions___pyx_unpickle_BC_Base};
6099 static PyObject *__pyx_pw_18BoundaryConditions_1__pyx_unpickle_BC_Base(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6100 PyObject *__pyx_v___pyx_type = 0;
6101 long __pyx_v___pyx_checksum;
6102 PyObject *__pyx_v___pyx_state = 0;
6103 int __pyx_lineno = 0;
6104 const char *__pyx_filename = NULL;
6105 int __pyx_clineno = 0;
6106 PyObject *__pyx_r = 0;
6107 __Pyx_RefNannyDeclarations
6108 __Pyx_RefNannySetupContext(
"__pyx_unpickle_BC_Base (wrapper)", 0);
6110 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
6111 PyObject* values[3] = {0,0,0};
6112 if (unlikely(__pyx_kwds)) {
6114 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6116 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6118 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6120 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6123 default:
goto __pyx_L5_argtuple_error;
6125 kw_args = PyDict_Size(__pyx_kwds);
6128 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
6129 else goto __pyx_L5_argtuple_error;
6132 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
6134 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_BC_Base", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
6138 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
6140 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_BC_Base", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
6143 if (unlikely(kw_args > 0)) {
6144 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__pyx_unpickle_BC_Base") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
6146 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
6147 goto __pyx_L5_argtuple_error;
6149 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6150 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6151 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6153 __pyx_v___pyx_type = values[0];
6154 __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]);
if (unlikely((__pyx_v___pyx_checksum == (
long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
6155 __pyx_v___pyx_state = values[2];
6157 goto __pyx_L4_argument_unpacking_done;
6158 __pyx_L5_argtuple_error:;
6159 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_BC_Base", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
6161 __Pyx_AddTraceback(
"BoundaryConditions.__pyx_unpickle_BC_Base", __pyx_clineno, __pyx_lineno, __pyx_filename);
6162 __Pyx_RefNannyFinishContext();
6164 __pyx_L4_argument_unpacking_done:;
6165 __pyx_r = __pyx_pf_18BoundaryConditions___pyx_unpickle_BC_Base(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
6168 __Pyx_RefNannyFinishContext();
6172 static PyObject *__pyx_pf_18BoundaryConditions___pyx_unpickle_BC_Base(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type,
long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
6173 PyObject *__pyx_v___pyx_PickleError = 0;
6174 PyObject *__pyx_v___pyx_result = 0;
6175 PyObject *__pyx_r = NULL;
6176 __Pyx_TraceDeclarations
6177 __Pyx_RefNannyDeclarations
6179 PyObject *__pyx_t_2 = NULL;
6180 PyObject *__pyx_t_3 = NULL;
6181 PyObject *__pyx_t_4 = NULL;
6182 PyObject *__pyx_t_5 = NULL;
6184 int __pyx_lineno = 0;
6185 const char *__pyx_filename = NULL;
6186 int __pyx_clineno = 0;
6187 __Pyx_TraceFrameInit(__pyx_codeobj__14)
6188 __Pyx_RefNannySetupContext(
"__pyx_unpickle_BC_Base", 0);
6189 __Pyx_TraceCall(
"__pyx_unpickle_BC_Base", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
6198 __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x96e6a1f) != 0);
6208 __pyx_t_2 = PyList_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
6209 __Pyx_GOTREF(__pyx_t_2);
6210 __Pyx_INCREF(__pyx_n_s_PickleError);
6211 __Pyx_GIVEREF(__pyx_n_s_PickleError);
6212 PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
6213 __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, -1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
6214 __Pyx_GOTREF(__pyx_t_3);
6215 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6216 __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
6217 __Pyx_GOTREF(__pyx_t_2);
6218 __Pyx_INCREF(__pyx_t_2);
6219 __pyx_v___pyx_PickleError = __pyx_t_2;
6220 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6221 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6230 __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error)
6231 __Pyx_GOTREF(__pyx_t_2);
6232 __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0x96, __pyx_t_2);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
6233 __Pyx_GOTREF(__pyx_t_4);
6234 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6235 __Pyx_INCREF(__pyx_v___pyx_PickleError);
6236 __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
6237 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
6238 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
6239 if (likely(__pyx_t_5)) {
6240 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
6241 __Pyx_INCREF(__pyx_t_5);
6242 __Pyx_INCREF(
function);
6243 __Pyx_DECREF_SET(__pyx_t_2,
function);
6246 __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
6247 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
6248 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6249 if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
6250 __Pyx_GOTREF(__pyx_t_3);
6251 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6252 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6253 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6254 __PYX_ERR(1, 6, __pyx_L1_error)
6272 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_18BoundaryConditions_BC_Base), __pyx_n_s_new);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
6273 __Pyx_GOTREF(__pyx_t_2);
6275 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
6276 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
6277 if (likely(__pyx_t_4)) {
6278 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
6279 __Pyx_INCREF(__pyx_t_4);
6280 __Pyx_INCREF(
function);
6281 __Pyx_DECREF_SET(__pyx_t_2,
function);
6284 __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
6285 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
6286 if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
6287 __Pyx_GOTREF(__pyx_t_3);
6288 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6289 __pyx_v___pyx_result = __pyx_t_3;
6299 __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
6300 __pyx_t_6 = (__pyx_t_1 != 0);
6310 if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
6311 __pyx_t_3 = __pyx_f_18BoundaryConditions___pyx_unpickle_BC_Base__set_state(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state));
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error)
6312 __Pyx_GOTREF(__pyx_t_3);
6313 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6331 __Pyx_XDECREF(__pyx_r);
6332 __Pyx_INCREF(__pyx_v___pyx_result);
6333 __pyx_r = __pyx_v___pyx_result;
6344 __Pyx_XDECREF(__pyx_t_2);
6345 __Pyx_XDECREF(__pyx_t_3);
6346 __Pyx_XDECREF(__pyx_t_4);
6347 __Pyx_XDECREF(__pyx_t_5);
6348 __Pyx_AddTraceback(
"BoundaryConditions.__pyx_unpickle_BC_Base", __pyx_clineno, __pyx_lineno, __pyx_filename);
6351 __Pyx_XDECREF(__pyx_v___pyx_PickleError);
6352 __Pyx_XDECREF(__pyx_v___pyx_result);
6353 __Pyx_XGIVEREF(__pyx_r);
6354 __Pyx_TraceReturn(__pyx_r, 0);
6355 __Pyx_RefNannyFinishContext();
6367 static PyObject *__pyx_f_18BoundaryConditions___pyx_unpickle_BC_Base__set_state(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
6368 PyObject *__pyx_r = NULL;
6369 __Pyx_TraceDeclarations
6370 __Pyx_RefNannyDeclarations
6371 PyObject *__pyx_t_1 = NULL;
6372 __Pyx_memviewslice __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
6375 Py_ssize_t __pyx_t_5;
6378 PyObject *__pyx_t_8 = NULL;
6379 PyObject *__pyx_t_9 = NULL;
6380 int __pyx_lineno = 0;
6381 const char *__pyx_filename = NULL;
6382 int __pyx_clineno = 0;
6383 __Pyx_RefNannySetupContext(
"__pyx_unpickle_BC_Base__set_state", 0);
6384 __Pyx_TraceCall(
"__pyx_unpickle_BC_Base__set_state", __pyx_f[1], 11, 0, __PYX_ERR(1, 11, __pyx_L1_error));
6393 if (unlikely(__pyx_v___pyx_state == Py_None)) {
6394 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
6395 __PYX_ERR(1, 12, __pyx_L1_error)
6397 if (!(likely(PyString_CheckExact(PyTuple_GET_ITEM(__pyx_v___pyx_state, 0)))||((PyTuple_GET_ITEM(__pyx_v___pyx_state, 0)) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"str", Py_TYPE(PyTuple_GET_ITEM(__pyx_v___pyx_state, 0))->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error)
6398 __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v___pyx_state, 0);
6399 __Pyx_INCREF(__pyx_t_1);
6400 __Pyx_GIVEREF(__pyx_t_1);
6401 __Pyx_GOTREF(__pyx_v___pyx_result->BC_type);
6402 __Pyx_DECREF(__pyx_v___pyx_result->BC_type);
6403 __pyx_v___pyx_result->BC_type = ((PyObject*)__pyx_t_1);
6405 if (unlikely(__pyx_v___pyx_state == Py_None)) {
6406 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
6407 __PYX_ERR(1, 12, __pyx_L1_error)
6409 __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v___pyx_state, 1);
6410 __Pyx_INCREF(__pyx_t_1);
6411 __Pyx_GIVEREF(__pyx_t_1);
6412 __Pyx_GOTREF(__pyx_v___pyx_result->Shape);
6413 __Pyx_DECREF(__pyx_v___pyx_result->Shape);
6414 __pyx_v___pyx_result->Shape = __pyx_t_1;
6416 if (unlikely(__pyx_v___pyx_state == Py_None)) {
6417 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
6418 __PYX_ERR(1, 12, __pyx_L1_error)
6420 __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyTuple_GET_ITEM(__pyx_v___pyx_state, 2), PyBUF_WRITABLE);
if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(1, 12, __pyx_L1_error)
6421 __PYX_XDEC_MEMVIEW(&__pyx_v___pyx_result->_b_or, 0);
6422 __pyx_v___pyx_result->_b_or = __pyx_t_2;
6423 __pyx_t_2.memview = NULL;
6424 __pyx_t_2.data = NULL;
6425 if (unlikely(__pyx_v___pyx_state == Py_None)) {
6426 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
6427 __PYX_ERR(1, 12, __pyx_L1_error)
6429 __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v___pyx_state, 3);
6430 __Pyx_INCREF(__pyx_t_1);
6431 __Pyx_GIVEREF(__pyx_t_1);
6432 __Pyx_GOTREF(__pyx_v___pyx_result->ct);
6433 __Pyx_DECREF(__pyx_v___pyx_result->ct);
6434 __pyx_v___pyx_result->ct = __pyx_t_1;
6436 if (unlikely(__pyx_v___pyx_state == Py_None)) {
6437 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
6438 __PYX_ERR(1, 12, __pyx_L1_error)
6440 if (!(likely(PyString_CheckExact(PyTuple_GET_ITEM(__pyx_v___pyx_state, 4)))||((PyTuple_GET_ITEM(__pyx_v___pyx_state, 4)) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"str", Py_TYPE(PyTuple_GET_ITEM(__pyx_v___pyx_state, 4))->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error)
6441 __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v___pyx_state, 4);
6442 __Pyx_INCREF(__pyx_t_1);
6443 __Pyx_GIVEREF(__pyx_t_1);
6444 __Pyx_GOTREF(__pyx_v___pyx_result->name);
6445 __Pyx_DECREF(__pyx_v___pyx_result->name);
6446 __pyx_v___pyx_result->name = ((PyObject*)__pyx_t_1);
6448 if (unlikely(__pyx_v___pyx_state == Py_None)) {
6449 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
6450 __PYX_ERR(1, 12, __pyx_L1_error)
6452 __pyx_t_3 = __Pyx_PyInt_As_int(PyTuple_GET_ITEM(__pyx_v___pyx_state, 5));
if (unlikely((__pyx_t_3 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
6453 __pyx_v___pyx_result->nd = __pyx_t_3;
6461 if (unlikely(__pyx_v___pyx_state == Py_None)) {
6462 PyErr_SetString(PyExc_TypeError,
"object of type 'NoneType' has no len()");
6463 __PYX_ERR(1, 13, __pyx_L1_error)
6465 __pyx_t_5 = PyTuple_GET_SIZE(__pyx_v___pyx_state);
if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
6466 __pyx_t_6 = ((__pyx_t_5 > 6) != 0);
6469 __pyx_t_4 = __pyx_t_6;
6470 goto __pyx_L4_bool_binop_done;
6472 __pyx_t_6 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict);
if (unlikely(__pyx_t_6 == ((
int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
6473 __pyx_t_7 = (__pyx_t_6 != 0);
6474 __pyx_t_4 = __pyx_t_7;
6475 __pyx_L4_bool_binop_done:;
6483 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 14, __pyx_L1_error)
6484 __Pyx_GOTREF(__pyx_t_8);
6485 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_update);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 14, __pyx_L1_error)
6486 __Pyx_GOTREF(__pyx_t_9);
6487 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6488 if (unlikely(__pyx_v___pyx_state == Py_None)) {
6489 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
6490 __PYX_ERR(1, 14, __pyx_L1_error)
6493 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
6494 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_9);
6495 if (likely(__pyx_t_8)) {
6496 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
6497 __Pyx_INCREF(__pyx_t_8);
6498 __Pyx_INCREF(
function);
6499 __Pyx_DECREF_SET(__pyx_t_9,
function);
6502 __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_8, PyTuple_GET_ITEM(__pyx_v___pyx_state, 6)) : __Pyx_PyObject_CallOneArg(__pyx_t_9, PyTuple_GET_ITEM(__pyx_v___pyx_state, 6));
6503 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
6504 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
6505 __Pyx_GOTREF(__pyx_t_1);
6506 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
6507 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6526 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6529 __Pyx_XDECREF(__pyx_t_1);
6530 __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
6531 __Pyx_XDECREF(__pyx_t_8);
6532 __Pyx_XDECREF(__pyx_t_9);
6533 __Pyx_AddTraceback(
"BoundaryConditions.__pyx_unpickle_BC_Base__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
6536 __Pyx_XGIVEREF(__pyx_r);
6537 __Pyx_TraceReturn(__pyx_r, 0);
6538 __Pyx_RefNannyFinishContext();
6550 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
6551 PyObject *__pyx_r = NULL;
6552 __Pyx_TraceDeclarations
6553 __Pyx_RefNannyDeclarations
6554 PyObject *__pyx_t_1 = NULL;
6555 int __pyx_lineno = 0;
6556 const char *__pyx_filename = NULL;
6557 int __pyx_clineno = 0;
6558 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew1", 0);
6559 __Pyx_TraceCall(
"PyArray_MultiIterNew1", __pyx_f[3], 735, 0, __PYX_ERR(3, 735, __pyx_L1_error));
6568 __Pyx_XDECREF(__pyx_r);
6569 __pyx_t_1 = PyArray_MultiIterNew(1, ((
void *)__pyx_v_a));
if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 736, __pyx_L1_error)
6570 __Pyx_GOTREF(__pyx_t_1);
6571 __pyx_r = __pyx_t_1;
6585 __Pyx_XDECREF(__pyx_t_1);
6586 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
6589 __Pyx_XGIVEREF(__pyx_r);
6590 __Pyx_TraceReturn(__pyx_r, 0);
6591 __Pyx_RefNannyFinishContext();
6603 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
6604 PyObject *__pyx_r = NULL;
6605 __Pyx_TraceDeclarations
6606 __Pyx_RefNannyDeclarations
6607 PyObject *__pyx_t_1 = NULL;
6608 int __pyx_lineno = 0;
6609 const char *__pyx_filename = NULL;
6610 int __pyx_clineno = 0;
6611 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew2", 0);
6612 __Pyx_TraceCall(
"PyArray_MultiIterNew2", __pyx_f[3], 738, 0, __PYX_ERR(3, 738, __pyx_L1_error));
6621 __Pyx_XDECREF(__pyx_r);
6622 __pyx_t_1 = PyArray_MultiIterNew(2, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b));
if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 739, __pyx_L1_error)
6623 __Pyx_GOTREF(__pyx_t_1);
6624 __pyx_r = __pyx_t_1;
6638 __Pyx_XDECREF(__pyx_t_1);
6639 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
6642 __Pyx_XGIVEREF(__pyx_r);
6643 __Pyx_TraceReturn(__pyx_r, 0);
6644 __Pyx_RefNannyFinishContext();
6656 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
6657 PyObject *__pyx_r = NULL;
6658 __Pyx_TraceDeclarations
6659 __Pyx_RefNannyDeclarations
6660 PyObject *__pyx_t_1 = NULL;
6661 int __pyx_lineno = 0;
6662 const char *__pyx_filename = NULL;
6663 int __pyx_clineno = 0;
6664 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew3", 0);
6665 __Pyx_TraceCall(
"PyArray_MultiIterNew3", __pyx_f[3], 741, 0, __PYX_ERR(3, 741, __pyx_L1_error));
6674 __Pyx_XDECREF(__pyx_r);
6675 __pyx_t_1 = PyArray_MultiIterNew(3, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b), ((
void *)__pyx_v_c));
if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 742, __pyx_L1_error)
6676 __Pyx_GOTREF(__pyx_t_1);
6677 __pyx_r = __pyx_t_1;
6691 __Pyx_XDECREF(__pyx_t_1);
6692 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
6695 __Pyx_XGIVEREF(__pyx_r);
6696 __Pyx_TraceReturn(__pyx_r, 0);
6697 __Pyx_RefNannyFinishContext();
6709 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
6710 PyObject *__pyx_r = NULL;
6711 __Pyx_TraceDeclarations
6712 __Pyx_RefNannyDeclarations
6713 PyObject *__pyx_t_1 = NULL;
6714 int __pyx_lineno = 0;
6715 const char *__pyx_filename = NULL;
6716 int __pyx_clineno = 0;
6717 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew4", 0);
6718 __Pyx_TraceCall(
"PyArray_MultiIterNew4", __pyx_f[3], 744, 0, __PYX_ERR(3, 744, __pyx_L1_error));
6727 __Pyx_XDECREF(__pyx_r);
6728 __pyx_t_1 = PyArray_MultiIterNew(4, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b), ((
void *)__pyx_v_c), ((
void *)__pyx_v_d));
if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 745, __pyx_L1_error)
6729 __Pyx_GOTREF(__pyx_t_1);
6730 __pyx_r = __pyx_t_1;
6744 __Pyx_XDECREF(__pyx_t_1);
6745 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
6748 __Pyx_XGIVEREF(__pyx_r);
6749 __Pyx_TraceReturn(__pyx_r, 0);
6750 __Pyx_RefNannyFinishContext();
6762 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
6763 PyObject *__pyx_r = NULL;
6764 __Pyx_TraceDeclarations
6765 __Pyx_RefNannyDeclarations
6766 PyObject *__pyx_t_1 = NULL;
6767 int __pyx_lineno = 0;
6768 const char *__pyx_filename = NULL;
6769 int __pyx_clineno = 0;
6770 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew5", 0);
6771 __Pyx_TraceCall(
"PyArray_MultiIterNew5", __pyx_f[3], 747, 0, __PYX_ERR(3, 747, __pyx_L1_error));
6780 __Pyx_XDECREF(__pyx_r);
6781 __pyx_t_1 = PyArray_MultiIterNew(5, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b), ((
void *)__pyx_v_c), ((
void *)__pyx_v_d), ((
void *)__pyx_v_e));
if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 748, __pyx_L1_error)
6782 __Pyx_GOTREF(__pyx_t_1);
6783 __pyx_r = __pyx_t_1;
6797 __Pyx_XDECREF(__pyx_t_1);
6798 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
6801 __Pyx_XGIVEREF(__pyx_r);
6802 __Pyx_TraceReturn(__pyx_r, 0);
6803 __Pyx_RefNannyFinishContext();
6815 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
6816 PyObject *__pyx_r = NULL;
6817 __Pyx_TraceDeclarations
6818 __Pyx_RefNannyDeclarations
6820 int __pyx_lineno = 0;
6821 const char *__pyx_filename = NULL;
6822 int __pyx_clineno = 0;
6823 __Pyx_RefNannySetupContext(
"PyDataType_SHAPE", 0);
6824 __Pyx_TraceCall(
"PyDataType_SHAPE", __pyx_f[3], 750, 0, __PYX_ERR(3, 750, __pyx_L1_error));
6833 __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
6843 __Pyx_XDECREF(__pyx_r);
6844 __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
6845 __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
6865 __Pyx_XDECREF(__pyx_r);
6866 __Pyx_INCREF(__pyx_empty_tuple);
6867 __pyx_r = __pyx_empty_tuple;
6881 __Pyx_AddTraceback(
"numpy.PyDataType_SHAPE", __pyx_clineno, __pyx_lineno, __pyx_filename);
6884 __Pyx_XGIVEREF(__pyx_r);
6885 __Pyx_TraceReturn(__pyx_r, 0);
6886 __Pyx_RefNannyFinishContext();
6898 static CYTHON_INLINE
void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
6899 __Pyx_TraceDeclarations
6900 __Pyx_RefNannyDeclarations
6901 int __pyx_lineno = 0;
6902 const char *__pyx_filename = NULL;
6903 int __pyx_clineno = 0;
6904 __Pyx_RefNannySetupContext(
"set_array_base", 0);
6905 __Pyx_TraceCall(
"set_array_base", __pyx_f[3], 929, 0, __PYX_ERR(3, 929, __pyx_L1_error));
6914 Py_INCREF(__pyx_v_base);
6923 (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base));
6936 __Pyx_WriteUnraisable(
"numpy.set_array_base", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
6938 __Pyx_TraceReturn(Py_None, 0);
6939 __Pyx_RefNannyFinishContext();
6950 static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
6951 PyObject *__pyx_v_base;
6952 PyObject *__pyx_r = NULL;
6953 __Pyx_TraceDeclarations
6954 __Pyx_RefNannyDeclarations
6956 int __pyx_lineno = 0;
6957 const char *__pyx_filename = NULL;
6958 int __pyx_clineno = 0;
6959 __Pyx_RefNannySetupContext(
"get_array_base", 0);
6960 __Pyx_TraceCall(
"get_array_base", __pyx_f[3], 933, 0, __PYX_ERR(3, 933, __pyx_L1_error));
6969 __pyx_v_base = PyArray_BASE(__pyx_v_arr);
6978 __pyx_t_1 = ((__pyx_v_base == NULL) != 0);
6988 __Pyx_XDECREF(__pyx_r);
6989 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7008 __Pyx_XDECREF(__pyx_r);
7009 __Pyx_INCREF(((PyObject *)__pyx_v_base));
7010 __pyx_r = ((PyObject *)__pyx_v_base);
7023 __Pyx_AddTraceback(
"numpy.get_array_base", __pyx_clineno, __pyx_lineno, __pyx_filename);
7026 __Pyx_XGIVEREF(__pyx_r);
7027 __Pyx_TraceReturn(__pyx_r, 0);
7028 __Pyx_RefNannyFinishContext();
7040 static CYTHON_INLINE
int __pyx_f_5numpy_import_array(
void) {
7042 __Pyx_TraceDeclarations
7043 __Pyx_RefNannyDeclarations
7044 PyObject *__pyx_t_1 = NULL;
7045 PyObject *__pyx_t_2 = NULL;
7046 PyObject *__pyx_t_3 = NULL;
7048 PyObject *__pyx_t_5 = NULL;
7049 PyObject *__pyx_t_6 = NULL;
7050 PyObject *__pyx_t_7 = NULL;
7051 PyObject *__pyx_t_8 = NULL;
7052 int __pyx_lineno = 0;
7053 const char *__pyx_filename = NULL;
7054 int __pyx_clineno = 0;
7055 __Pyx_RefNannySetupContext(
"import_array", 0);
7056 __Pyx_TraceCall(
"import_array", __pyx_f[3], 941, 0, __PYX_ERR(3, 941, __pyx_L1_error));
7066 __Pyx_PyThreadState_declare
7067 __Pyx_PyThreadState_assign
7068 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
7069 __Pyx_XGOTREF(__pyx_t_1);
7070 __Pyx_XGOTREF(__pyx_t_2);
7071 __Pyx_XGOTREF(__pyx_t_3);
7081 __pyx_t_4 = _import_array();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(3, 943, __pyx_L3_error)
7091 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
7092 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
7093 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7094 goto __pyx_L8_try_end;
7104 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
7106 __Pyx_AddTraceback(
"numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
7107 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(3, 944, __pyx_L5_except_error)
7108 __Pyx_GOTREF(__pyx_t_5);
7109 __Pyx_GOTREF(__pyx_t_6);
7110 __Pyx_GOTREF(__pyx_t_7);
7119 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__15, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 945, __pyx_L5_except_error)
7120 __Pyx_GOTREF(__pyx_t_8);
7121 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
7122 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7123 __PYX_ERR(3, 945, __pyx_L5_except_error)
7125 goto __pyx_L5_except_error;
7126 __pyx_L5_except_error:;
7135 __Pyx_XGIVEREF(__pyx_t_1);
7136 __Pyx_XGIVEREF(__pyx_t_2);
7137 __Pyx_XGIVEREF(__pyx_t_3);
7138 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
7139 goto __pyx_L1_error;
7155 __Pyx_XDECREF(__pyx_t_5);
7156 __Pyx_XDECREF(__pyx_t_6);
7157 __Pyx_XDECREF(__pyx_t_7);
7158 __Pyx_XDECREF(__pyx_t_8);
7159 __Pyx_AddTraceback(
"numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
7162 __Pyx_TraceReturn(Py_None, 0);
7163 __Pyx_RefNannyFinishContext();
7175 static CYTHON_INLINE
int __pyx_f_5numpy_import_umath(
void) {
7177 __Pyx_TraceDeclarations
7178 __Pyx_RefNannyDeclarations
7179 PyObject *__pyx_t_1 = NULL;
7180 PyObject *__pyx_t_2 = NULL;
7181 PyObject *__pyx_t_3 = NULL;
7183 PyObject *__pyx_t_5 = NULL;
7184 PyObject *__pyx_t_6 = NULL;
7185 PyObject *__pyx_t_7 = NULL;
7186 PyObject *__pyx_t_8 = NULL;
7187 int __pyx_lineno = 0;
7188 const char *__pyx_filename = NULL;
7189 int __pyx_clineno = 0;
7190 __Pyx_RefNannySetupContext(
"import_umath", 0);
7191 __Pyx_TraceCall(
"import_umath", __pyx_f[3], 947, 0, __PYX_ERR(3, 947, __pyx_L1_error));
7201 __Pyx_PyThreadState_declare
7202 __Pyx_PyThreadState_assign
7203 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
7204 __Pyx_XGOTREF(__pyx_t_1);
7205 __Pyx_XGOTREF(__pyx_t_2);
7206 __Pyx_XGOTREF(__pyx_t_3);
7216 __pyx_t_4 = _import_umath();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(3, 949, __pyx_L3_error)
7226 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
7227 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
7228 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7229 goto __pyx_L8_try_end;
7239 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
7241 __Pyx_AddTraceback(
"numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
7242 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(3, 950, __pyx_L5_except_error)
7243 __Pyx_GOTREF(__pyx_t_5);
7244 __Pyx_GOTREF(__pyx_t_6);
7245 __Pyx_GOTREF(__pyx_t_7);
7254 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__16, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 951, __pyx_L5_except_error)
7255 __Pyx_GOTREF(__pyx_t_8);
7256 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
7257 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7258 __PYX_ERR(3, 951, __pyx_L5_except_error)
7260 goto __pyx_L5_except_error;
7261 __pyx_L5_except_error:;
7270 __Pyx_XGIVEREF(__pyx_t_1);
7271 __Pyx_XGIVEREF(__pyx_t_2);
7272 __Pyx_XGIVEREF(__pyx_t_3);
7273 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
7274 goto __pyx_L1_error;
7290 __Pyx_XDECREF(__pyx_t_5);
7291 __Pyx_XDECREF(__pyx_t_6);
7292 __Pyx_XDECREF(__pyx_t_7);
7293 __Pyx_XDECREF(__pyx_t_8);
7294 __Pyx_AddTraceback(
"numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
7297 __Pyx_TraceReturn(Py_None, 0);
7298 __Pyx_RefNannyFinishContext();
7310 static CYTHON_INLINE
int __pyx_f_5numpy_import_ufunc(
void) {
7312 __Pyx_TraceDeclarations
7313 __Pyx_RefNannyDeclarations
7314 PyObject *__pyx_t_1 = NULL;
7315 PyObject *__pyx_t_2 = NULL;
7316 PyObject *__pyx_t_3 = NULL;
7318 PyObject *__pyx_t_5 = NULL;
7319 PyObject *__pyx_t_6 = NULL;
7320 PyObject *__pyx_t_7 = NULL;
7321 PyObject *__pyx_t_8 = NULL;
7322 int __pyx_lineno = 0;
7323 const char *__pyx_filename = NULL;
7324 int __pyx_clineno = 0;
7325 __Pyx_RefNannySetupContext(
"import_ufunc", 0);
7326 __Pyx_TraceCall(
"import_ufunc", __pyx_f[3], 953, 0, __PYX_ERR(3, 953, __pyx_L1_error));
7336 __Pyx_PyThreadState_declare
7337 __Pyx_PyThreadState_assign
7338 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
7339 __Pyx_XGOTREF(__pyx_t_1);
7340 __Pyx_XGOTREF(__pyx_t_2);
7341 __Pyx_XGOTREF(__pyx_t_3);
7351 __pyx_t_4 = _import_umath();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(3, 955, __pyx_L3_error)
7361 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
7362 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
7363 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7364 goto __pyx_L8_try_end;
7374 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
7376 __Pyx_AddTraceback(
"numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
7377 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(3, 956, __pyx_L5_except_error)
7378 __Pyx_GOTREF(__pyx_t_5);
7379 __Pyx_GOTREF(__pyx_t_6);
7380 __Pyx_GOTREF(__pyx_t_7);
7389 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__16, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 957, __pyx_L5_except_error)
7390 __Pyx_GOTREF(__pyx_t_8);
7391 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
7392 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7393 __PYX_ERR(3, 957, __pyx_L5_except_error)
7395 goto __pyx_L5_except_error;
7396 __pyx_L5_except_error:;
7405 __Pyx_XGIVEREF(__pyx_t_1);
7406 __Pyx_XGIVEREF(__pyx_t_2);
7407 __Pyx_XGIVEREF(__pyx_t_3);
7408 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
7409 goto __pyx_L1_error;
7425 __Pyx_XDECREF(__pyx_t_5);
7426 __Pyx_XDECREF(__pyx_t_6);
7427 __Pyx_XDECREF(__pyx_t_7);
7428 __Pyx_XDECREF(__pyx_t_8);
7429 __Pyx_AddTraceback(
"numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
7432 __Pyx_TraceReturn(Py_None, 0);
7433 __Pyx_RefNannyFinishContext();
7445 static CYTHON_INLINE
int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) {
7447 __Pyx_TraceDeclarations
7448 __Pyx_RefNannyDeclarations
7449 int __pyx_lineno = 0;
7450 const char *__pyx_filename = NULL;
7451 int __pyx_clineno = 0;
7452 __Pyx_RefNannySetupContext(
"is_timedelta64_object", 0);
7453 __Pyx_TraceCall(
"is_timedelta64_object", __pyx_f[3], 967, 0, __PYX_ERR(3, 967, __pyx_L1_error));
7462 __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type));
7475 __Pyx_WriteUnraisable(
"numpy.is_timedelta64_object", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
7478 __Pyx_TraceReturn(Py_None, 0);
7479 __Pyx_RefNannyFinishContext();
7491 static CYTHON_INLINE
int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) {
7493 __Pyx_TraceDeclarations
7494 __Pyx_RefNannyDeclarations
7495 int __pyx_lineno = 0;
7496 const char *__pyx_filename = NULL;
7497 int __pyx_clineno = 0;
7498 __Pyx_RefNannySetupContext(
"is_datetime64_object", 0);
7499 __Pyx_TraceCall(
"is_datetime64_object", __pyx_f[3], 982, 0, __PYX_ERR(3, 982, __pyx_L1_error));
7508 __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type));
7521 __Pyx_WriteUnraisable(
"numpy.is_datetime64_object", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
7524 __Pyx_TraceReturn(Py_None, 0);
7525 __Pyx_RefNannyFinishContext();
7537 static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) {
7538 npy_datetime __pyx_r;
7539 __Pyx_TraceDeclarations
7540 int __pyx_lineno = 0;
7541 const char *__pyx_filename = NULL;
7542 int __pyx_clineno = 0;
7543 __Pyx_TraceCall(
"get_datetime64_value", __pyx_f[3], 997, 1, __PYX_ERR(3, 997, __pyx_L1_error));
7552 __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval;
7565 __Pyx_WriteUnraisable(
"numpy.get_datetime64_value", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
7568 __Pyx_TraceReturn(Py_None, 1);
7580 static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) {
7581 npy_timedelta __pyx_r;
7582 __Pyx_TraceDeclarations
7583 int __pyx_lineno = 0;
7584 const char *__pyx_filename = NULL;
7585 int __pyx_clineno = 0;
7586 __Pyx_TraceCall(
"get_timedelta64_value", __pyx_f[3], 1007, 1, __PYX_ERR(3, 1007, __pyx_L1_error));
7595 __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval;
7608 __Pyx_WriteUnraisable(
"numpy.get_timedelta64_value", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
7611 __Pyx_TraceReturn(Py_None, 1);
7623 static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) {
7624 NPY_DATETIMEUNIT __pyx_r;
7625 __Pyx_TraceDeclarations
7626 int __pyx_lineno = 0;
7627 const char *__pyx_filename = NULL;
7628 int __pyx_clineno = 0;
7629 __Pyx_TraceCall(
"get_datetime64_unit", __pyx_f[3], 1014, 1, __PYX_ERR(3, 1014, __pyx_L1_error));
7636 __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base);
7649 __Pyx_WriteUnraisable(
"numpy.get_datetime64_unit", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
7650 __pyx_r = (NPY_DATETIMEUNIT) 0;
7652 __Pyx_TraceReturn(Py_None, 1);
7665 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
7666 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7667 PyObject *__pyx_v_shape = 0;
7668 Py_ssize_t __pyx_v_itemsize;
7669 PyObject *__pyx_v_format = 0;
7670 PyObject *__pyx_v_mode = 0;
7671 int __pyx_v_allocate_buffer;
7672 int __pyx_lineno = 0;
7673 const char *__pyx_filename = NULL;
7674 int __pyx_clineno = 0;
7676 __Pyx_RefNannyDeclarations
7677 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
7679 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_itemsize,&__pyx_n_s_format,&__pyx_n_s_mode,&__pyx_n_s_allocate_buffer,0};
7680 PyObject* values[5] = {0,0,0,0,0};
7681 values[3] = ((PyObject *)__pyx_n_s_c);
7682 if (unlikely(__pyx_kwds)) {
7684 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
7686 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
7688 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7690 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7692 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7694 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7697 default:
goto __pyx_L5_argtuple_error;
7699 kw_args = PyDict_Size(__pyx_kwds);
7702 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--;
7703 else goto __pyx_L5_argtuple_error;
7706 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--;
7708 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 3, 5, 1); __PYX_ERR(1, 122, __pyx_L3_error)
7712 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--;
7714 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 3, 5, 2); __PYX_ERR(1, 122, __pyx_L3_error)
7719 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
7720 if (value) { values[3] = value; kw_args--; }
7725 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allocate_buffer);
7726 if (value) { values[4] = value; kw_args--; }
7729 if (unlikely(kw_args > 0)) {
7730 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(1, 122, __pyx_L3_error)
7733 switch (PyTuple_GET_SIZE(__pyx_args)) {
7734 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
7736 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7738 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7739 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7740 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7742 default:
goto __pyx_L5_argtuple_error;
7745 __pyx_v_shape = ((PyObject*)values[0]);
7746 __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]);
if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 122, __pyx_L3_error)
7747 __pyx_v_format = values[2];
7748 __pyx_v_mode = values[3];
7750 __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]);
if (unlikely((__pyx_v_allocate_buffer == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 123, __pyx_L3_error)
7760 __pyx_v_allocate_buffer = ((int)1);
7763 goto __pyx_L4_argument_unpacking_done;
7764 __pyx_L5_argtuple_error:;
7765 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 122, __pyx_L3_error)
7767 __Pyx_AddTraceback(
"View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7768 __Pyx_RefNannyFinishContext();
7770 __pyx_L4_argument_unpacking_done:;
7771 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1,
"shape", 1))) __PYX_ERR(1, 122, __pyx_L1_error)
7772 if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
7773 PyErr_Format(PyExc_TypeError,
"Argument '%.200s' must not be None",
"format"); __PYX_ERR(1, 122, __pyx_L1_error)
7775 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(((
struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer);
7790 __Pyx_RefNannyFinishContext();
7794 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode,
int __pyx_v_allocate_buffer) {
7796 Py_ssize_t __pyx_v_i;
7797 Py_ssize_t __pyx_v_dim;
7798 PyObject **__pyx_v_p;
7801 __Pyx_TraceDeclarations
7802 __Pyx_RefNannyDeclarations
7803 Py_ssize_t __pyx_t_1;
7805 PyObject *__pyx_t_3 = NULL;
7807 PyObject *__pyx_t_5 = NULL;
7808 PyObject *__pyx_t_6 = NULL;
7811 Py_ssize_t __pyx_t_9;
7812 PyObject *__pyx_t_10 = NULL;
7813 Py_ssize_t __pyx_t_11;
7814 int __pyx_lineno = 0;
7815 const char *__pyx_filename = NULL;
7816 int __pyx_clineno = 0;
7817 __Pyx_RefNannySetupContext(
"__cinit__", 0);
7818 __Pyx_TraceCall(
"__cinit__", __pyx_f[1], 122, 0, __PYX_ERR(1, 122, __pyx_L1_error));
7819 __Pyx_INCREF(__pyx_v_format);
7828 if (unlikely(__pyx_v_shape == Py_None)) {
7829 PyErr_SetString(PyExc_TypeError,
"object of type 'NoneType' has no len()");
7830 __PYX_ERR(1, 129, __pyx_L1_error)
7832 __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape);
if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 129, __pyx_L1_error)
7833 __pyx_v_self->ndim = ((int)__pyx_t_1);
7842 __pyx_v_self->itemsize = __pyx_v_itemsize;
7851 __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
7852 if (unlikely(__pyx_t_2)) {
7861 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__17, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 133, __pyx_L1_error)
7862 __Pyx_GOTREF(__pyx_t_3);
7863 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7864 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7865 __PYX_ERR(1, 133, __pyx_L1_error)
7883 __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0);
7884 if (unlikely(__pyx_t_2)) {
7893 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 136, __pyx_L1_error)
7894 __Pyx_GOTREF(__pyx_t_3);
7895 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7896 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7897 __PYX_ERR(1, 136, __pyx_L1_error)
7915 __pyx_t_2 = PyBytes_Check(__pyx_v_format);
7916 __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
7926 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 139, __pyx_L1_error)
7927 __Pyx_GOTREF(__pyx_t_5);
7929 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
7930 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
7931 if (likely(__pyx_t_6)) {
7932 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
7933 __Pyx_INCREF(__pyx_t_6);
7934 __Pyx_INCREF(
function);
7935 __Pyx_DECREF_SET(__pyx_t_5,
function);
7938 __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_n_s_ASCII) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_n_s_ASCII);
7939 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
7940 if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 139, __pyx_L1_error)
7941 __Pyx_GOTREF(__pyx_t_3);
7942 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7943 __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_3);
7962 if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(1, 140, __pyx_L1_error)
7963 __pyx_t_3 = __pyx_v_format;
7964 __Pyx_INCREF(__pyx_t_3);
7965 __Pyx_GIVEREF(__pyx_t_3);
7966 __Pyx_GOTREF(__pyx_v_self->_format);
7967 __Pyx_DECREF(__pyx_v_self->_format);
7968 __pyx_v_self->_format = ((PyObject*)__pyx_t_3);
7978 if (unlikely(__pyx_v_self->_format == Py_None)) {
7979 PyErr_SetString(PyExc_TypeError,
"expected bytes, NoneType found");
7980 __PYX_ERR(1, 141, __pyx_L1_error)
7982 __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format);
if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(1, 141, __pyx_L1_error)
7983 __pyx_v_self->format = __pyx_t_7;
7992 __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((
sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
8001 __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
8010 __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0);
8011 if (unlikely(__pyx_t_4)) {
8020 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__19, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 148, __pyx_L1_error)
8021 __Pyx_GOTREF(__pyx_t_3);
8022 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
8023 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8024 __PYX_ERR(1, 148, __pyx_L1_error)
8043 __pyx_t_3 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0;
8045 if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3))
break;
8046 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8047 __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++;
if (unlikely(0 < 0)) __PYX_ERR(1, 151, __pyx_L1_error)
8049 __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++;
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 151, __pyx_L1_error)
8050 __Pyx_GOTREF(__pyx_t_5);
8052 __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5);
if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 151, __pyx_L1_error)
8053 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8054 __pyx_v_dim = __pyx_t_9;
8055 __pyx_v_idx = __pyx_t_8;
8056 __pyx_t_8 = (__pyx_t_8 + 1);
8065 __pyx_t_4 = ((__pyx_v_dim <= 0) != 0);
8066 if (unlikely(__pyx_t_4)) {
8075 __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_idx);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 153, __pyx_L1_error)
8076 __Pyx_GOTREF(__pyx_t_5);
8077 __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_dim);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 153, __pyx_L1_error)
8078 __Pyx_GOTREF(__pyx_t_6);
8079 __pyx_t_10 = PyTuple_New(2);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 153, __pyx_L1_error)
8080 __Pyx_GOTREF(__pyx_t_10);
8081 __Pyx_GIVEREF(__pyx_t_5);
8082 PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5);
8083 __Pyx_GIVEREF(__pyx_t_6);
8084 PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_6);
8087 __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 153, __pyx_L1_error)
8088 __Pyx_GOTREF(__pyx_t_6);
8089 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8090 __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 153, __pyx_L1_error)
8091 __Pyx_GOTREF(__pyx_t_10);
8092 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8093 __Pyx_Raise(__pyx_t_10, 0, 0, 0);
8094 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8095 __PYX_ERR(1, 153, __pyx_L1_error)
8113 (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
8123 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8132 __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ));
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 157, __pyx_L1_error)
8142 __pyx_v_order =
'F';
8151 __Pyx_INCREF(__pyx_n_u_fortran);
8152 __Pyx_GIVEREF(__pyx_n_u_fortran);
8153 __Pyx_GOTREF(__pyx_v_self->mode);
8154 __Pyx_DECREF(__pyx_v_self->mode);
8155 __pyx_v_self->mode = __pyx_n_u_fortran;
8174 __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ));
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 160, __pyx_L1_error)
8175 if (likely(__pyx_t_4)) {
8184 __pyx_v_order =
'C';
8193 __Pyx_INCREF(__pyx_n_u_c);
8194 __Pyx_GIVEREF(__pyx_n_u_c);
8195 __Pyx_GOTREF(__pyx_v_self->mode);
8196 __Pyx_DECREF(__pyx_v_self->mode);
8197 __pyx_v_self->mode = __pyx_n_u_c;
8217 __pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 164, __pyx_L1_error)
8218 __Pyx_GOTREF(__pyx_t_3);
8219 __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 164, __pyx_L1_error)
8220 __Pyx_GOTREF(__pyx_t_10);
8221 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8222 __Pyx_Raise(__pyx_t_10, 0, 0, 0);
8223 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8224 __PYX_ERR(1, 164, __pyx_L1_error)
8235 __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order);
8244 __pyx_v_self->free_data = __pyx_v_allocate_buffer;
8253 __pyx_t_10 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_10);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 170, __pyx_L1_error)
8254 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10);
if (unlikely((__pyx_t_4 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 170, __pyx_L1_error)
8255 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8256 __pyx_v_self->dtype_is_object = __pyx_t_4;
8265 __pyx_t_4 = (__pyx_v_allocate_buffer != 0);
8275 __pyx_v_self->data = ((
char *)malloc(__pyx_v_self->len));
8284 __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0);
8285 if (unlikely(__pyx_t_4)) {
8294 __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__20, NULL);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 176, __pyx_L1_error)
8295 __Pyx_GOTREF(__pyx_t_10);
8296 __Pyx_Raise(__pyx_t_10, 0, 0, 0);
8297 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8298 __PYX_ERR(1, 176, __pyx_L1_error)
8316 __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0);
8326 __pyx_v_p = ((PyObject **)__pyx_v_self->data);
8335 if (unlikely(__pyx_v_itemsize == 0)) {
8336 PyErr_SetString(PyExc_ZeroDivisionError,
"integer division or modulo by zero");
8337 __PYX_ERR(1, 180, __pyx_L1_error)
8339 else if (
sizeof(Py_ssize_t) ==
sizeof(
long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
8340 PyErr_SetString(PyExc_OverflowError,
"value too large to perform division");
8341 __PYX_ERR(1, 180, __pyx_L1_error)
8343 __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize);
8344 __pyx_t_9 = __pyx_t_1;
8345 for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) {
8346 __pyx_v_i = __pyx_t_11;
8355 (__pyx_v_p[__pyx_v_i]) = Py_None;
8397 __Pyx_XDECREF(__pyx_t_3);
8398 __Pyx_XDECREF(__pyx_t_5);
8399 __Pyx_XDECREF(__pyx_t_6);
8400 __Pyx_XDECREF(__pyx_t_10);
8401 __Pyx_AddTraceback(
"View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8404 __Pyx_XDECREF(__pyx_v_format);
8405 __Pyx_TraceReturn(Py_None, 0);
8406 __Pyx_RefNannyFinishContext();
8419 static CYTHON_UNUSED
int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
8420 static CYTHON_UNUSED
int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
8422 __Pyx_RefNannyDeclarations
8423 __Pyx_RefNannySetupContext(
"__getbuffer__ (wrapper)", 0);
8424 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(((
struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((
int)__pyx_v_flags));
8427 __Pyx_RefNannyFinishContext();
8431 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(
struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
8432 int __pyx_v_bufmode;
8434 __Pyx_TraceDeclarations
8435 __Pyx_RefNannyDeclarations
8438 PyObject *__pyx_t_3 = NULL;
8440 Py_ssize_t __pyx_t_5;
8442 Py_ssize_t *__pyx_t_7;
8443 int __pyx_lineno = 0;
8444 const char *__pyx_filename = NULL;
8445 int __pyx_clineno = 0;
8446 if (__pyx_v_info == NULL) {
8447 PyErr_SetString(PyExc_BufferError,
"PyObject_GetBuffer: view==NULL argument is obsolete");
8450 __Pyx_RefNannySetupContext(
"__getbuffer__", 0);
8451 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
8452 __Pyx_GIVEREF(__pyx_v_info->obj);
8453 __Pyx_TraceCall(
"__getbuffer__", __pyx_f[1], 185, 0, __PYX_ERR(1, 185, __pyx_L1_error));
8462 __pyx_v_bufmode = -1;
8471 __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ));
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 187, __pyx_L1_error)
8472 __pyx_t_2 = (__pyx_t_1 != 0);
8482 __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
8501 __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ));
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 189, __pyx_L1_error)
8502 __pyx_t_1 = (__pyx_t_2 != 0);
8512 __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
8531 __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
8532 if (unlikely(__pyx_t_1)) {
8541 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__21, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 192, __pyx_L1_error)
8542 __Pyx_GOTREF(__pyx_t_3);
8543 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
8544 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8545 __PYX_ERR(1, 192, __pyx_L1_error)
8563 __pyx_t_4 = __pyx_v_self->data;
8564 __pyx_v_info->buf = __pyx_t_4;
8573 __pyx_t_5 = __pyx_v_self->len;
8574 __pyx_v_info->len = __pyx_t_5;
8583 __pyx_t_6 = __pyx_v_self->ndim;
8584 __pyx_v_info->ndim = __pyx_t_6;
8593 __pyx_t_7 = __pyx_v_self->_shape;
8594 __pyx_v_info->shape = __pyx_t_7;
8603 __pyx_t_7 = __pyx_v_self->_strides;
8604 __pyx_v_info->strides = __pyx_t_7;
8613 __pyx_v_info->suboffsets = NULL;
8622 __pyx_t_5 = __pyx_v_self->itemsize;
8623 __pyx_v_info->itemsize = __pyx_t_5;
8632 __pyx_v_info->readonly = 0;
8641 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
8651 __pyx_t_4 = __pyx_v_self->format;
8652 __pyx_v_info->format = __pyx_t_4;
8672 __pyx_v_info->format = NULL;
8683 __Pyx_INCREF(((PyObject *)__pyx_v_self));
8684 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
8685 __Pyx_GOTREF(__pyx_v_info->obj);
8686 __Pyx_DECREF(__pyx_v_info->obj);
8687 __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
8701 __Pyx_XDECREF(__pyx_t_3);
8702 __Pyx_AddTraceback(
"View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8704 if (__pyx_v_info->obj != NULL) {
8705 __Pyx_GOTREF(__pyx_v_info->obj);
8706 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
8710 if (__pyx_v_info->obj == Py_None) {
8711 __Pyx_GOTREF(__pyx_v_info->obj);
8712 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
8715 __Pyx_TraceReturn(Py_None, 0);
8716 __Pyx_RefNannyFinishContext();
8729 static void __pyx_array___dealloc__(PyObject *__pyx_v_self);
8730 static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
8731 __Pyx_RefNannyDeclarations
8732 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
8733 __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((
struct __pyx_array_obj *)__pyx_v_self));
8736 __Pyx_RefNannyFinishContext();
8739 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(
struct __pyx_array_obj *__pyx_v_self) {
8740 __Pyx_TraceDeclarations
8741 __Pyx_RefNannyDeclarations
8743 int __pyx_lineno = 0;
8744 const char *__pyx_filename = NULL;
8745 int __pyx_clineno = 0;
8746 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
8747 __Pyx_TraceCall(
"__dealloc__", __pyx_f[1], 211, 0, __PYX_ERR(1, 211, __pyx_L1_error));
8756 __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
8766 __pyx_v_self->callback_free_data(__pyx_v_self->data);
8785 __pyx_t_1 = (__pyx_v_self->free_data != 0);
8795 __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
8805 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
8823 free(__pyx_v_self->data);
8842 PyObject_Free(__pyx_v_self->_shape);
8855 __Pyx_WriteUnraisable(
"View.MemoryView.array.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
8857 __Pyx_TraceReturn(Py_None, 0);
8858 __Pyx_RefNannyFinishContext();
8870 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self);
8871 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
8872 PyObject *__pyx_r = 0;
8873 __Pyx_RefNannyDeclarations
8874 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
8875 __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((
struct __pyx_array_obj *)__pyx_v_self));
8878 __Pyx_RefNannyFinishContext();
8882 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(
struct __pyx_array_obj *__pyx_v_self) {
8883 PyObject *__pyx_r = NULL;
8884 __Pyx_TraceDeclarations
8885 __Pyx_RefNannyDeclarations
8886 PyObject *__pyx_t_1 = NULL;
8887 int __pyx_lineno = 0;
8888 const char *__pyx_filename = NULL;
8889 int __pyx_clineno = 0;
8890 __Pyx_RefNannySetupContext(
"__get__", 0);
8891 __Pyx_TraceCall(
"__get__", __pyx_f[1], 222, 0, __PYX_ERR(1, 222, __pyx_L1_error));
8900 __Pyx_XDECREF(__pyx_r);
8901 __pyx_t_1 = ((
struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 223, __pyx_L1_error)
8902 __Pyx_GOTREF(__pyx_t_1);
8903 __pyx_r = __pyx_t_1;
8917 __Pyx_XDECREF(__pyx_t_1);
8918 __Pyx_AddTraceback(
"View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8921 __Pyx_XGIVEREF(__pyx_r);
8922 __Pyx_TraceReturn(__pyx_r, 0);
8923 __Pyx_RefNannyFinishContext();
8935 static PyObject *__pyx_array_get_memview(
struct __pyx_array_obj *__pyx_v_self) {
8937 PyObject *__pyx_r = NULL;
8938 __Pyx_TraceDeclarations
8939 __Pyx_RefNannyDeclarations
8940 PyObject *__pyx_t_1 = NULL;
8941 PyObject *__pyx_t_2 = NULL;
8942 PyObject *__pyx_t_3 = NULL;
8943 int __pyx_lineno = 0;
8944 const char *__pyx_filename = NULL;
8945 int __pyx_clineno = 0;
8946 __Pyx_RefNannySetupContext(
"get_memview", 0);
8947 __Pyx_TraceCall(
"get_memview", __pyx_f[1], 226, 0, __PYX_ERR(1, 226, __pyx_L1_error));
8956 __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
8965 __Pyx_XDECREF(__pyx_r);
8966 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 228, __pyx_L1_error)
8967 __Pyx_GOTREF(__pyx_t_1);
8968 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 228, __pyx_L1_error)
8969 __Pyx_GOTREF(__pyx_t_2);
8970 __pyx_t_3 = PyTuple_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 228, __pyx_L1_error)
8971 __Pyx_GOTREF(__pyx_t_3);
8972 __Pyx_INCREF(((PyObject *)__pyx_v_self));
8973 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
8974 PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
8975 __Pyx_GIVEREF(__pyx_t_1);
8976 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
8977 __Pyx_GIVEREF(__pyx_t_2);
8978 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
8981 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 228, __pyx_L1_error)
8982 __Pyx_GOTREF(__pyx_t_2);
8983 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8984 __pyx_r = __pyx_t_2;
8998 __Pyx_XDECREF(__pyx_t_1);
8999 __Pyx_XDECREF(__pyx_t_2);
9000 __Pyx_XDECREF(__pyx_t_3);
9001 __Pyx_AddTraceback(
"View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
9004 __Pyx_XGIVEREF(__pyx_r);
9005 __Pyx_TraceReturn(__pyx_r, 0);
9006 __Pyx_RefNannyFinishContext();
9019 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self);
9020 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
9022 __Pyx_RefNannyDeclarations
9023 __Pyx_RefNannySetupContext(
"__len__ (wrapper)", 0);
9024 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((
struct __pyx_array_obj *)__pyx_v_self));
9027 __Pyx_RefNannyFinishContext();
9031 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(
struct __pyx_array_obj *__pyx_v_self) {
9033 __Pyx_TraceDeclarations
9034 __Pyx_RefNannyDeclarations
9035 int __pyx_lineno = 0;
9036 const char *__pyx_filename = NULL;
9037 int __pyx_clineno = 0;
9038 __Pyx_RefNannySetupContext(
"__len__", 0);
9039 __Pyx_TraceCall(
"__len__", __pyx_f[1], 230, 0, __PYX_ERR(1, 230, __pyx_L1_error));
9048 __pyx_r = (__pyx_v_self->_shape[0]);
9061 __Pyx_AddTraceback(
"View.MemoryView.array.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9064 __Pyx_TraceReturn(Py_None, 0);
9065 __Pyx_RefNannyFinishContext();
9078 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr);
9079 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
9080 PyObject *__pyx_r = 0;
9081 __Pyx_RefNannyDeclarations
9082 __Pyx_RefNannySetupContext(
"__getattr__ (wrapper)", 0);
9083 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
9086 __Pyx_RefNannyFinishContext();
9090 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
9091 PyObject *__pyx_r = NULL;
9092 __Pyx_TraceDeclarations
9093 __Pyx_RefNannyDeclarations
9094 PyObject *__pyx_t_1 = NULL;
9095 PyObject *__pyx_t_2 = NULL;
9096 int __pyx_lineno = 0;
9097 const char *__pyx_filename = NULL;
9098 int __pyx_clineno = 0;
9099 __Pyx_RefNannySetupContext(
"__getattr__", 0);
9100 __Pyx_TraceCall(
"__getattr__", __pyx_f[1], 233, 0, __PYX_ERR(1, 233, __pyx_L1_error));
9109 __Pyx_XDECREF(__pyx_r);
9110 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 234, __pyx_L1_error)
9111 __Pyx_GOTREF(__pyx_t_1);
9112 __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 234, __pyx_L1_error)
9113 __Pyx_GOTREF(__pyx_t_2);
9114 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9115 __pyx_r = __pyx_t_2;
9129 __Pyx_XDECREF(__pyx_t_1);
9130 __Pyx_XDECREF(__pyx_t_2);
9131 __Pyx_AddTraceback(
"View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9134 __Pyx_XGIVEREF(__pyx_r);
9135 __Pyx_TraceReturn(__pyx_r, 0);
9136 __Pyx_RefNannyFinishContext();
9149 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item);
9150 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
9151 PyObject *__pyx_r = 0;
9152 __Pyx_RefNannyDeclarations
9153 __Pyx_RefNannySetupContext(
"__getitem__ (wrapper)", 0);
9154 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
9157 __Pyx_RefNannyFinishContext();
9161 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
9162 PyObject *__pyx_r = NULL;
9163 __Pyx_TraceDeclarations
9164 __Pyx_RefNannyDeclarations
9165 PyObject *__pyx_t_1 = NULL;
9166 PyObject *__pyx_t_2 = NULL;
9167 int __pyx_lineno = 0;
9168 const char *__pyx_filename = NULL;
9169 int __pyx_clineno = 0;
9170 __Pyx_RefNannySetupContext(
"__getitem__", 0);
9171 __Pyx_TraceCall(
"__getitem__", __pyx_f[1], 236, 0, __PYX_ERR(1, 236, __pyx_L1_error));
9180 __Pyx_XDECREF(__pyx_r);
9181 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 237, __pyx_L1_error)
9182 __Pyx_GOTREF(__pyx_t_1);
9183 __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 237, __pyx_L1_error)
9184 __Pyx_GOTREF(__pyx_t_2);
9185 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9186 __pyx_r = __pyx_t_2;
9200 __Pyx_XDECREF(__pyx_t_1);
9201 __Pyx_XDECREF(__pyx_t_2);
9202 __Pyx_AddTraceback(
"View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9205 __Pyx_XGIVEREF(__pyx_r);
9206 __Pyx_TraceReturn(__pyx_r, 0);
9207 __Pyx_RefNannyFinishContext();
9220 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value);
9221 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
9223 __Pyx_RefNannyDeclarations
9224 __Pyx_RefNannySetupContext(
"__setitem__ (wrapper)", 0);
9225 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value));
9228 __Pyx_RefNannyFinishContext();
9232 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
9234 __Pyx_TraceDeclarations
9235 __Pyx_RefNannyDeclarations
9236 PyObject *__pyx_t_1 = NULL;
9237 int __pyx_lineno = 0;
9238 const char *__pyx_filename = NULL;
9239 int __pyx_clineno = 0;
9240 __Pyx_RefNannySetupContext(
"__setitem__", 0);
9241 __Pyx_TraceCall(
"__setitem__", __pyx_f[1], 239, 0, __PYX_ERR(1, 239, __pyx_L1_error));
9250 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 240, __pyx_L1_error)
9251 __Pyx_GOTREF(__pyx_t_1);
9252 if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(1, 240, __pyx_L1_error)
9253 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9267 __Pyx_XDECREF(__pyx_t_1);
9268 __Pyx_AddTraceback(
"View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9271 __Pyx_TraceReturn(Py_None, 0);
9272 __Pyx_RefNannyFinishContext();
9283 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
9284 static PyMethodDef __pyx_mdef___pyx_array_1__reduce_cython__ = {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0};
9285 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9286 PyObject *__pyx_r = 0;
9287 __Pyx_RefNannyDeclarations
9288 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
9289 __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((
struct __pyx_array_obj *)__pyx_v_self));
9292 __Pyx_RefNannyFinishContext();
9296 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self) {
9297 PyObject *__pyx_r = NULL;
9298 __Pyx_TraceDeclarations
9299 __Pyx_RefNannyDeclarations
9300 PyObject *__pyx_t_1 = NULL;
9301 int __pyx_lineno = 0;
9302 const char *__pyx_filename = NULL;
9303 int __pyx_clineno = 0;
9304 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
9305 __Pyx_TraceCall(
"__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
9313 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__22, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
9314 __Pyx_GOTREF(__pyx_t_1);
9315 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
9316 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9317 __PYX_ERR(1, 2, __pyx_L1_error)
9327 __Pyx_XDECREF(__pyx_t_1);
9328 __Pyx_AddTraceback(
"View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9330 __Pyx_XGIVEREF(__pyx_r);
9331 __Pyx_TraceReturn(__pyx_r, 0);
9332 __Pyx_RefNannyFinishContext();
9344 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
9345 static PyMethodDef __pyx_mdef___pyx_array_3__setstate_cython__ = {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0};
9346 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
9347 PyObject *__pyx_r = 0;
9348 __Pyx_RefNannyDeclarations
9349 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
9350 __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
9353 __Pyx_RefNannyFinishContext();
9357 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
9358 PyObject *__pyx_r = NULL;
9359 __Pyx_TraceDeclarations
9360 __Pyx_RefNannyDeclarations
9361 PyObject *__pyx_t_1 = NULL;
9362 int __pyx_lineno = 0;
9363 const char *__pyx_filename = NULL;
9364 int __pyx_clineno = 0;
9365 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
9366 __Pyx_TraceCall(
"__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
9373 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__23, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
9374 __Pyx_GOTREF(__pyx_t_1);
9375 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
9376 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9377 __PYX_ERR(1, 4, __pyx_L1_error)
9388 __Pyx_XDECREF(__pyx_t_1);
9389 __Pyx_AddTraceback(
"View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9391 __Pyx_XGIVEREF(__pyx_r);
9392 __Pyx_TraceReturn(__pyx_r, 0);
9393 __Pyx_RefNannyFinishContext();
9405 static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize,
char *__pyx_v_format,
char *__pyx_v_mode,
char *__pyx_v_buf) {
9406 struct __pyx_array_obj *__pyx_v_result = 0;
9407 struct __pyx_array_obj *__pyx_r = NULL;
9408 __Pyx_TraceDeclarations
9409 __Pyx_RefNannyDeclarations
9411 PyObject *__pyx_t_2 = NULL;
9412 PyObject *__pyx_t_3 = NULL;
9413 PyObject *__pyx_t_4 = NULL;
9414 PyObject *__pyx_t_5 = NULL;
9415 int __pyx_lineno = 0;
9416 const char *__pyx_filename = NULL;
9417 int __pyx_clineno = 0;
9418 __Pyx_RefNannySetupContext(
"array_cwrapper", 0);
9419 __Pyx_TraceCall(
"array_cwrapper", __pyx_f[1], 244, 0, __PYX_ERR(1, 244, __pyx_L1_error));
9428 __pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
9438 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 249, __pyx_L1_error)
9439 __Pyx_GOTREF(__pyx_t_2);
9440 __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 249, __pyx_L1_error)
9441 __Pyx_GOTREF(__pyx_t_3);
9442 __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 249, __pyx_L1_error)
9443 __Pyx_GOTREF(__pyx_t_4);
9444 __pyx_t_5 = PyTuple_New(4);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 249, __pyx_L1_error)
9445 __Pyx_GOTREF(__pyx_t_5);
9446 __Pyx_INCREF(__pyx_v_shape);
9447 __Pyx_GIVEREF(__pyx_v_shape);
9448 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape);
9449 __Pyx_GIVEREF(__pyx_t_2);
9450 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
9451 __Pyx_GIVEREF(__pyx_t_3);
9452 PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
9453 __Pyx_GIVEREF(__pyx_t_4);
9454 PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
9458 __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 249, __pyx_L1_error)
9459 __Pyx_GOTREF(__pyx_t_4);
9460 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9461 __pyx_v_result = ((
struct __pyx_array_obj *)__pyx_t_4);
9482 __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 251, __pyx_L1_error)
9483 __Pyx_GOTREF(__pyx_t_4);
9484 __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 251, __pyx_L1_error)
9485 __Pyx_GOTREF(__pyx_t_5);
9486 __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 251, __pyx_L1_error)
9487 __Pyx_GOTREF(__pyx_t_3);
9488 __pyx_t_2 = PyTuple_New(4);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 251, __pyx_L1_error)
9489 __Pyx_GOTREF(__pyx_t_2);
9490 __Pyx_INCREF(__pyx_v_shape);
9491 __Pyx_GIVEREF(__pyx_v_shape);
9492 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
9493 __Pyx_GIVEREF(__pyx_t_4);
9494 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
9495 __Pyx_GIVEREF(__pyx_t_5);
9496 PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
9497 __Pyx_GIVEREF(__pyx_t_3);
9498 PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
9510 __pyx_t_3 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 252, __pyx_L1_error)
9511 __Pyx_GOTREF(__pyx_t_3);
9512 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(1, 252, __pyx_L1_error)
9521 __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 251, __pyx_L1_error)
9522 __Pyx_GOTREF(__pyx_t_5);
9523 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9524 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9525 __pyx_v_result = ((
struct __pyx_array_obj *)__pyx_t_5);
9535 __pyx_v_result->data = __pyx_v_buf;
9546 __Pyx_XDECREF(((PyObject *)__pyx_r));
9547 __Pyx_INCREF(((PyObject *)__pyx_v_result));
9548 __pyx_r = __pyx_v_result;
9561 __Pyx_XDECREF(__pyx_t_2);
9562 __Pyx_XDECREF(__pyx_t_3);
9563 __Pyx_XDECREF(__pyx_t_4);
9564 __Pyx_XDECREF(__pyx_t_5);
9565 __Pyx_AddTraceback(
"View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
9568 __Pyx_XDECREF((PyObject *)__pyx_v_result);
9569 __Pyx_XGIVEREF((PyObject *)__pyx_r);
9570 __Pyx_TraceReturn(__pyx_r, 0);
9571 __Pyx_RefNannyFinishContext();
9584 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
9585 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9586 PyObject *__pyx_v_name = 0;
9587 int __pyx_lineno = 0;
9588 const char *__pyx_filename = NULL;
9589 int __pyx_clineno = 0;
9591 __Pyx_RefNannyDeclarations
9592 __Pyx_RefNannySetupContext(
"__init__ (wrapper)", 0);
9594 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
9595 PyObject* values[1] = {0};
9596 if (unlikely(__pyx_kwds)) {
9598 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9600 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9603 default:
goto __pyx_L5_argtuple_error;
9605 kw_args = PyDict_Size(__pyx_kwds);
9608 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
9609 else goto __pyx_L5_argtuple_error;
9611 if (unlikely(kw_args > 0)) {
9612 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__init__") < 0)) __PYX_ERR(1, 281, __pyx_L3_error)
9614 }
else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
9615 goto __pyx_L5_argtuple_error;
9617 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9619 __pyx_v_name = values[0];
9621 goto __pyx_L4_argument_unpacking_done;
9622 __pyx_L5_argtuple_error:;
9623 __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 281, __pyx_L3_error)
9625 __Pyx_AddTraceback(
"View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9626 __Pyx_RefNannyFinishContext();
9628 __pyx_L4_argument_unpacking_done:;
9629 __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
9632 __Pyx_RefNannyFinishContext();
9636 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
9638 __Pyx_TraceDeclarations
9639 __Pyx_RefNannyDeclarations
9640 int __pyx_lineno = 0;
9641 const char *__pyx_filename = NULL;
9642 int __pyx_clineno = 0;
9643 __Pyx_RefNannySetupContext(
"__init__", 0);
9644 __Pyx_TraceCall(
"__init__", __pyx_f[1], 281, 0, __PYX_ERR(1, 281, __pyx_L1_error));
9653 __Pyx_INCREF(__pyx_v_name);
9654 __Pyx_GIVEREF(__pyx_v_name);
9655 __Pyx_GOTREF(__pyx_v_self->name);
9656 __Pyx_DECREF(__pyx_v_self->name);
9657 __pyx_v_self->name = __pyx_v_name;
9671 __Pyx_AddTraceback(
"View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9674 __Pyx_TraceReturn(Py_None, 0);
9675 __Pyx_RefNannyFinishContext();
9688 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self);
9689 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
9690 PyObject *__pyx_r = 0;
9691 __Pyx_RefNannyDeclarations
9692 __Pyx_RefNannySetupContext(
"__repr__ (wrapper)", 0);
9693 __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self));
9696 __Pyx_RefNannyFinishContext();
9700 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(
struct __pyx_MemviewEnum_obj *__pyx_v_self) {
9701 PyObject *__pyx_r = NULL;
9702 __Pyx_TraceDeclarations
9703 __Pyx_RefNannyDeclarations
9704 int __pyx_lineno = 0;
9705 const char *__pyx_filename = NULL;
9706 int __pyx_clineno = 0;
9707 __Pyx_RefNannySetupContext(
"__repr__", 0);
9708 __Pyx_TraceCall(
"__repr__", __pyx_f[1], 283, 0, __PYX_ERR(1, 283, __pyx_L1_error));
9717 __Pyx_XDECREF(__pyx_r);
9718 __Pyx_INCREF(__pyx_v_self->name);
9719 __pyx_r = __pyx_v_self->name;
9732 __Pyx_AddTraceback(
"View.MemoryView.Enum.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9735 __Pyx_XGIVEREF(__pyx_r);
9736 __Pyx_TraceReturn(__pyx_r, 0);
9737 __Pyx_RefNannyFinishContext();
9748 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
9749 static PyMethodDef __pyx_mdef___pyx_MemviewEnum_1__reduce_cython__ = {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0};
9750 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9751 PyObject *__pyx_r = 0;
9752 __Pyx_RefNannyDeclarations
9753 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
9754 __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self));
9757 __Pyx_RefNannyFinishContext();
9761 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self) {
9762 PyObject *__pyx_v_state = 0;
9763 PyObject *__pyx_v__dict = 0;
9764 int __pyx_v_use_setstate;
9765 PyObject *__pyx_r = NULL;
9766 __Pyx_TraceDeclarations
9767 __Pyx_RefNannyDeclarations
9768 PyObject *__pyx_t_1 = NULL;
9771 PyObject *__pyx_t_4 = NULL;
9772 PyObject *__pyx_t_5 = NULL;
9773 int __pyx_lineno = 0;
9774 const char *__pyx_filename = NULL;
9775 int __pyx_clineno = 0;
9776 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
9777 __Pyx_TraceCall(
"__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
9786 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
9787 __Pyx_GOTREF(__pyx_t_1);
9788 __Pyx_INCREF(__pyx_v_self->name);
9789 __Pyx_GIVEREF(__pyx_v_self->name);
9790 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name);
9791 __pyx_v_state = ((PyObject*)__pyx_t_1);
9801 __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
9802 __Pyx_GOTREF(__pyx_t_1);
9803 __pyx_v__dict = __pyx_t_1;
9813 __pyx_t_2 = (__pyx_v__dict != Py_None);
9814 __pyx_t_3 = (__pyx_t_2 != 0);
9824 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
9825 __Pyx_GOTREF(__pyx_t_1);
9826 __Pyx_INCREF(__pyx_v__dict);
9827 __Pyx_GIVEREF(__pyx_v__dict);
9828 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
9829 __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error)
9830 __Pyx_GOTREF(__pyx_t_4);
9831 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9832 __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
9842 __pyx_v_use_setstate = 1;
9862 __pyx_t_3 = (__pyx_v_self->name != Py_None);
9863 __pyx_v_use_setstate = __pyx_t_3;
9874 __pyx_t_3 = (__pyx_v_use_setstate != 0);
9884 __Pyx_XDECREF(__pyx_r);
9885 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Enum);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
9886 __Pyx_GOTREF(__pyx_t_4);
9887 __pyx_t_1 = PyTuple_New(3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
9888 __Pyx_GOTREF(__pyx_t_1);
9889 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9890 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9891 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9892 __Pyx_INCREF(__pyx_int_184977713);
9893 __Pyx_GIVEREF(__pyx_int_184977713);
9894 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
9895 __Pyx_INCREF(Py_None);
9896 __Pyx_GIVEREF(Py_None);
9897 PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
9898 __pyx_t_5 = PyTuple_New(3);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error)
9899 __Pyx_GOTREF(__pyx_t_5);
9900 __Pyx_GIVEREF(__pyx_t_4);
9901 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
9902 __Pyx_GIVEREF(__pyx_t_1);
9903 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
9904 __Pyx_INCREF(__pyx_v_state);
9905 __Pyx_GIVEREF(__pyx_v_state);
9906 PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
9909 __pyx_r = __pyx_t_5;
9930 __Pyx_XDECREF(__pyx_r);
9931 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_Enum);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)
9932 __Pyx_GOTREF(__pyx_t_5);
9933 __pyx_t_1 = PyTuple_New(3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
9934 __Pyx_GOTREF(__pyx_t_1);
9935 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9936 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9937 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9938 __Pyx_INCREF(__pyx_int_184977713);
9939 __Pyx_GIVEREF(__pyx_int_184977713);
9940 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
9941 __Pyx_INCREF(__pyx_v_state);
9942 __Pyx_GIVEREF(__pyx_v_state);
9943 PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
9944 __pyx_t_4 = PyTuple_New(2);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
9945 __Pyx_GOTREF(__pyx_t_4);
9946 __Pyx_GIVEREF(__pyx_t_5);
9947 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
9948 __Pyx_GIVEREF(__pyx_t_1);
9949 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
9952 __pyx_r = __pyx_t_4;
9965 __Pyx_XDECREF(__pyx_t_1);
9966 __Pyx_XDECREF(__pyx_t_4);
9967 __Pyx_XDECREF(__pyx_t_5);
9968 __Pyx_AddTraceback(
"View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9971 __Pyx_XDECREF(__pyx_v_state);
9972 __Pyx_XDECREF(__pyx_v__dict);
9973 __Pyx_XGIVEREF(__pyx_r);
9974 __Pyx_TraceReturn(__pyx_r, 0);
9975 __Pyx_RefNannyFinishContext();
9987 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
9988 static PyMethodDef __pyx_mdef___pyx_MemviewEnum_3__setstate_cython__ = {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0};
9989 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
9990 PyObject *__pyx_r = 0;
9991 __Pyx_RefNannyDeclarations
9992 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
9993 __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
9996 __Pyx_RefNannyFinishContext();
10000 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
10001 PyObject *__pyx_r = NULL;
10002 __Pyx_TraceDeclarations
10003 __Pyx_RefNannyDeclarations
10004 PyObject *__pyx_t_1 = NULL;
10005 int __pyx_lineno = 0;
10006 const char *__pyx_filename = NULL;
10007 int __pyx_clineno = 0;
10008 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
10009 __Pyx_TraceCall(
"__setstate_cython__", __pyx_f[1], 16, 0, __PYX_ERR(1, 16, __pyx_L1_error));
10016 if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
10017 __pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
10018 __Pyx_GOTREF(__pyx_t_1);
10019 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10029 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10032 __Pyx_XDECREF(__pyx_t_1);
10033 __Pyx_AddTraceback(
"View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10036 __Pyx_XGIVEREF(__pyx_r);
10037 __Pyx_TraceReturn(__pyx_r, 0);
10038 __Pyx_RefNannyFinishContext();
10050 static void *__pyx_align_pointer(
void *__pyx_v_memory,
size_t __pyx_v_alignment) {
10051 Py_intptr_t __pyx_v_aligned_p;
10052 size_t __pyx_v_offset;
10054 __Pyx_TraceDeclarations
10056 int __pyx_lineno = 0;
10057 const char *__pyx_filename = NULL;
10058 int __pyx_clineno = 0;
10059 __Pyx_TraceCall(
"align_pointer", __pyx_f[1], 298, 1, __PYX_ERR(1, 298, __pyx_L1_error));
10068 __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);
10077 __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);
10086 __pyx_t_1 = ((__pyx_v_offset > 0) != 0);
10096 __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
10114 __pyx_r = ((
void *)__pyx_v_aligned_p);
10127 __Pyx_WriteUnraisable(
"View.MemoryView.align_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
10130 __Pyx_TraceReturn(Py_None, 1);
10143 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
10144 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
10145 PyObject *__pyx_v_obj = 0;
10147 int __pyx_v_dtype_is_object;
10148 int __pyx_lineno = 0;
10149 const char *__pyx_filename = NULL;
10150 int __pyx_clineno = 0;
10152 __Pyx_RefNannyDeclarations
10153 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
10155 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0};
10156 PyObject* values[3] = {0,0,0};
10157 if (unlikely(__pyx_kwds)) {
10158 Py_ssize_t kw_args;
10159 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
10160 switch (pos_args) {
10161 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10162 CYTHON_FALLTHROUGH;
10163 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10164 CYTHON_FALLTHROUGH;
10165 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10166 CYTHON_FALLTHROUGH;
10168 default:
goto __pyx_L5_argtuple_error;
10170 kw_args = PyDict_Size(__pyx_kwds);
10171 switch (pos_args) {
10173 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
10174 else goto __pyx_L5_argtuple_error;
10175 CYTHON_FALLTHROUGH;
10177 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--;
10179 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 2, 3, 1); __PYX_ERR(1, 345, __pyx_L3_error)
10181 CYTHON_FALLTHROUGH;
10184 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype_is_object);
10185 if (value) { values[2] = value; kw_args--; }
10188 if (unlikely(kw_args > 0)) {
10189 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(1, 345, __pyx_L3_error)
10192 switch (PyTuple_GET_SIZE(__pyx_args)) {
10193 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10194 CYTHON_FALLTHROUGH;
10195 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10196 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10198 default:
goto __pyx_L5_argtuple_error;
10201 __pyx_v_obj = values[0];
10202 __pyx_v_flags = __Pyx_PyInt_As_int(values[1]);
if (unlikely((__pyx_v_flags == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 345, __pyx_L3_error)
10204 __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]);
if (unlikely((__pyx_v_dtype_is_object == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 345, __pyx_L3_error)
10206 __pyx_v_dtype_is_object = ((int)0);
10209 goto __pyx_L4_argument_unpacking_done;
10210 __pyx_L5_argtuple_error:;
10211 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 345, __pyx_L3_error)
10213 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10214 __Pyx_RefNannyFinishContext();
10216 __pyx_L4_argument_unpacking_done:;
10217 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(((
struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object);
10220 __Pyx_RefNannyFinishContext();
10224 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj,
int __pyx_v_flags,
int __pyx_v_dtype_is_object) {
10226 __Pyx_TraceDeclarations
10227 __Pyx_RefNannyDeclarations
10232 int __pyx_lineno = 0;
10233 const char *__pyx_filename = NULL;
10234 int __pyx_clineno = 0;
10235 __Pyx_RefNannySetupContext(
"__cinit__", 0);
10236 __Pyx_TraceCall(
"__cinit__", __pyx_f[1], 345, 0, __PYX_ERR(1, 345, __pyx_L1_error));
10245 __Pyx_INCREF(__pyx_v_obj);
10246 __Pyx_GIVEREF(__pyx_v_obj);
10247 __Pyx_GOTREF(__pyx_v_self->obj);
10248 __Pyx_DECREF(__pyx_v_self->obj);
10249 __pyx_v_self->obj = __pyx_v_obj;
10258 __pyx_v_self->flags = __pyx_v_flags;
10267 __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
10268 __pyx_t_3 = (__pyx_t_2 != 0);
10271 __pyx_t_1 = __pyx_t_3;
10272 goto __pyx_L4_bool_binop_done;
10274 __pyx_t_3 = (__pyx_v_obj != Py_None);
10275 __pyx_t_2 = (__pyx_t_3 != 0);
10276 __pyx_t_1 = __pyx_t_2;
10277 __pyx_L4_bool_binop_done:;
10287 __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags);
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 349, __pyx_L1_error)
10296 __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
10306 ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
10315 Py_INCREF(Py_None);
10342 __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0);
10352 __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
10361 __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
10379 __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
10389 __pyx_v_self->lock = PyThread_allocate_lock();
10398 __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
10399 if (unlikely(__pyx_t_1)) {
10408 PyErr_NoMemory(); __PYX_ERR(1, 361, __pyx_L1_error)
10435 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
10445 __pyx_t_2 = (((__pyx_v_self->view.format[0]) ==
'O') != 0);
10448 __pyx_t_1 = __pyx_t_2;
10449 goto __pyx_L11_bool_binop_done;
10451 __pyx_t_2 = (((__pyx_v_self->view.format[1]) ==
'\x00') != 0);
10452 __pyx_t_1 = __pyx_t_2;
10453 __pyx_L11_bool_binop_done:;
10454 __pyx_v_self->dtype_is_object = __pyx_t_1;
10474 __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
10485 __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((
void *)(&(__pyx_v_self->acquisition_count[0]))), (
sizeof(__pyx_atomic_int))));
10494 __pyx_v_self->typeinfo = NULL;
10508 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10511 __Pyx_TraceReturn(Py_None, 0);
10512 __Pyx_RefNannyFinishContext();
10525 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self);
10526 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
10527 __Pyx_RefNannyDeclarations
10528 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
10529 __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
10532 __Pyx_RefNannyFinishContext();
10535 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(
struct __pyx_memoryview_obj *__pyx_v_self) {
10537 __Pyx_TraceDeclarations
10538 __Pyx_RefNannyDeclarations
10544 PyThread_type_lock __pyx_t_6;
10545 PyThread_type_lock __pyx_t_7;
10546 int __pyx_lineno = 0;
10547 const char *__pyx_filename = NULL;
10548 int __pyx_clineno = 0;
10549 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
10550 __Pyx_TraceCall(
"__dealloc__", __pyx_f[1], 372, 0, __PYX_ERR(1, 372, __pyx_L1_error));
10559 __pyx_t_1 = (__pyx_v_self->obj != Py_None);
10560 __pyx_t_2 = (__pyx_t_1 != 0);
10570 __Pyx_ReleaseBuffer((&__pyx_v_self->view));
10589 __pyx_t_2 = ((((Py_buffer *)(&__pyx_v_self->view))->obj == Py_None) != 0);
10599 ((Py_buffer *)(&__pyx_v_self->view))->obj = NULL;
10608 Py_DECREF(Py_None);
10627 __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
10637 __pyx_t_3 = __pyx_memoryview_thread_locks_used;
10638 __pyx_t_4 = __pyx_t_3;
10639 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
10640 __pyx_v_i = __pyx_t_5;
10649 __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0);
10659 __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
10668 __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0);
10678 __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
10679 __pyx_t_7 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
10688 (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_6;
10689 (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_7;
10707 goto __pyx_L6_break;
10727 PyThread_free_lock(__pyx_v_self->lock);
10751 __Pyx_WriteUnraisable(
"View.MemoryView.memoryview.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
10753 __Pyx_TraceReturn(Py_None, 0);
10754 __Pyx_RefNannyFinishContext();
10765 static char *__pyx_memoryview_get_item_pointer(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
10766 Py_ssize_t __pyx_v_dim;
10767 char *__pyx_v_itemp;
10768 PyObject *__pyx_v_idx = NULL;
10770 __Pyx_TraceDeclarations
10771 __Pyx_RefNannyDeclarations
10772 Py_ssize_t __pyx_t_1;
10773 PyObject *__pyx_t_2 = NULL;
10774 Py_ssize_t __pyx_t_3;
10775 PyObject *(*__pyx_t_4)(PyObject *);
10776 PyObject *__pyx_t_5 = NULL;
10777 Py_ssize_t __pyx_t_6;
10779 int __pyx_lineno = 0;
10780 const char *__pyx_filename = NULL;
10781 int __pyx_clineno = 0;
10782 __Pyx_RefNannySetupContext(
"get_item_pointer", 0);
10783 __Pyx_TraceCall(
"get_item_pointer", __pyx_f[1], 393, 0, __PYX_ERR(1, 393, __pyx_L1_error));
10792 __pyx_v_itemp = ((
char *)__pyx_v_self->view.buf);
10802 if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
10803 __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
10806 __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 397, __pyx_L1_error)
10807 __Pyx_GOTREF(__pyx_t_2);
10808 __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext;
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 397, __pyx_L1_error)
10811 if (likely(!__pyx_t_4)) {
10812 if (likely(PyList_CheckExact(__pyx_t_2))) {
10813 if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2))
break;
10814 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10815 __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++;
if (unlikely(0 < 0)) __PYX_ERR(1, 397, __pyx_L1_error)
10817 __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++;
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 397, __pyx_L1_error)
10818 __Pyx_GOTREF(__pyx_t_5);
10821 if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2))
break;
10822 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10823 __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++;
if (unlikely(0 < 0)) __PYX_ERR(1, 397, __pyx_L1_error)
10825 __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++;
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 397, __pyx_L1_error)
10826 __Pyx_GOTREF(__pyx_t_5);
10830 __pyx_t_5 = __pyx_t_4(__pyx_t_2);
10831 if (unlikely(!__pyx_t_5)) {
10832 PyObject* exc_type = PyErr_Occurred();
10834 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
10835 else __PYX_ERR(1, 397, __pyx_L1_error)
10839 __Pyx_GOTREF(__pyx_t_5);
10841 __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
10843 __pyx_v_dim = __pyx_t_1;
10844 __pyx_t_1 = (__pyx_t_1 + 1);
10853 __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx);
if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 398, __pyx_L1_error)
10854 __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim);
if (unlikely(__pyx_t_7 == ((
char *)NULL))) __PYX_ERR(1, 398, __pyx_L1_error)
10855 __pyx_v_itemp = __pyx_t_7;
10865 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10874 __pyx_r = __pyx_v_itemp;
10887 __Pyx_XDECREF(__pyx_t_2);
10888 __Pyx_XDECREF(__pyx_t_5);
10889 __Pyx_AddTraceback(
"View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
10892 __Pyx_XDECREF(__pyx_v_idx);
10893 __Pyx_TraceReturn(Py_None, 0);
10894 __Pyx_RefNannyFinishContext();
10907 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index);
10908 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
10909 PyObject *__pyx_r = 0;
10910 __Pyx_RefNannyDeclarations
10911 __Pyx_RefNannySetupContext(
"__getitem__ (wrapper)", 0);
10912 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
10915 __Pyx_RefNannyFinishContext();
10919 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
10920 PyObject *__pyx_v_have_slices = NULL;
10921 PyObject *__pyx_v_indices = NULL;
10922 char *__pyx_v_itemp;
10923 PyObject *__pyx_r = NULL;
10924 __Pyx_TraceDeclarations
10925 __Pyx_RefNannyDeclarations
10928 PyObject *__pyx_t_3 = NULL;
10929 PyObject *__pyx_t_4 = NULL;
10930 PyObject *__pyx_t_5 = NULL;
10932 int __pyx_lineno = 0;
10933 const char *__pyx_filename = NULL;
10934 int __pyx_clineno = 0;
10935 __Pyx_RefNannySetupContext(
"__getitem__", 0);
10936 __Pyx_TraceCall(
"__getitem__", __pyx_f[1], 403, 0, __PYX_ERR(1, 403, __pyx_L1_error));
10945 __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
10946 __pyx_t_2 = (__pyx_t_1 != 0);
10956 __Pyx_XDECREF(__pyx_r);
10957 __Pyx_INCREF(((PyObject *)__pyx_v_self));
10958 __pyx_r = ((PyObject *)__pyx_v_self);
10977 __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 407, __pyx_L1_error)
10978 __Pyx_GOTREF(__pyx_t_3);
10979 if (likely(__pyx_t_3 != Py_None)) {
10980 PyObject* sequence = __pyx_t_3;
10981 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
10982 if (unlikely(size != 2)) {
10983 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
10984 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
10985 __PYX_ERR(1, 407, __pyx_L1_error)
10987 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10988 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
10989 __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
10990 __Pyx_INCREF(__pyx_t_4);
10991 __Pyx_INCREF(__pyx_t_5);
10993 __pyx_t_4 = PySequence_ITEM(sequence, 0);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 407, __pyx_L1_error)
10994 __Pyx_GOTREF(__pyx_t_4);
10995 __pyx_t_5 = PySequence_ITEM(sequence, 1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 407, __pyx_L1_error)
10996 __Pyx_GOTREF(__pyx_t_5);
10998 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11000 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 407, __pyx_L1_error)
11002 __pyx_v_have_slices = __pyx_t_4;
11004 __pyx_v_indices = __pyx_t_5;
11014 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices);
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 410, __pyx_L1_error)
11024 __Pyx_XDECREF(__pyx_r);
11025 __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices));
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 411, __pyx_L1_error)
11026 __Pyx_GOTREF(__pyx_t_3);
11027 __pyx_r = __pyx_t_3;
11048 __pyx_t_6 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices);
if (unlikely(__pyx_t_6 == ((
char *)NULL))) __PYX_ERR(1, 413, __pyx_L1_error)
11049 __pyx_v_itemp = __pyx_t_6;
11058 __Pyx_XDECREF(__pyx_r);
11059 __pyx_t_3 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 414, __pyx_L1_error)
11060 __Pyx_GOTREF(__pyx_t_3);
11061 __pyx_r = __pyx_t_3;
11076 __Pyx_XDECREF(__pyx_t_3);
11077 __Pyx_XDECREF(__pyx_t_4);
11078 __Pyx_XDECREF(__pyx_t_5);
11079 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11082 __Pyx_XDECREF(__pyx_v_have_slices);
11083 __Pyx_XDECREF(__pyx_v_indices);
11084 __Pyx_XGIVEREF(__pyx_r);
11085 __Pyx_TraceReturn(__pyx_r, 0);
11086 __Pyx_RefNannyFinishContext();
11099 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value);
11100 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
11102 __Pyx_RefNannyDeclarations
11103 __Pyx_RefNannySetupContext(
"__setitem__ (wrapper)", 0);
11104 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value));
11107 __Pyx_RefNannyFinishContext();
11111 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
11112 PyObject *__pyx_v_have_slices = NULL;
11113 PyObject *__pyx_v_obj = NULL;
11115 __Pyx_TraceDeclarations
11116 __Pyx_RefNannyDeclarations
11118 PyObject *__pyx_t_2 = NULL;
11119 PyObject *__pyx_t_3 = NULL;
11120 PyObject *__pyx_t_4 = NULL;
11121 int __pyx_lineno = 0;
11122 const char *__pyx_filename = NULL;
11123 int __pyx_clineno = 0;
11124 __Pyx_RefNannySetupContext(
"__setitem__", 0);
11125 __Pyx_TraceCall(
"__setitem__", __pyx_f[1], 416, 0, __PYX_ERR(1, 416, __pyx_L1_error));
11126 __Pyx_INCREF(__pyx_v_index);
11135 __pyx_t_1 = (__pyx_v_self->view.readonly != 0);
11136 if (unlikely(__pyx_t_1)) {
11145 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__24, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 418, __pyx_L1_error)
11146 __Pyx_GOTREF(__pyx_t_2);
11147 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
11148 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11149 __PYX_ERR(1, 418, __pyx_L1_error)
11167 __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 420, __pyx_L1_error)
11168 __Pyx_GOTREF(__pyx_t_2);
11169 if (likely(__pyx_t_2 != Py_None)) {
11170 PyObject* sequence = __pyx_t_2;
11171 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
11172 if (unlikely(size != 2)) {
11173 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
11174 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
11175 __PYX_ERR(1, 420, __pyx_L1_error)
11177 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11178 __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
11179 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
11180 __Pyx_INCREF(__pyx_t_3);
11181 __Pyx_INCREF(__pyx_t_4);
11183 __pyx_t_3 = PySequence_ITEM(sequence, 0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 420, __pyx_L1_error)
11184 __Pyx_GOTREF(__pyx_t_3);
11185 __pyx_t_4 = PySequence_ITEM(sequence, 1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 420, __pyx_L1_error)
11186 __Pyx_GOTREF(__pyx_t_4);
11188 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11190 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 420, __pyx_L1_error)
11192 __pyx_v_have_slices = __pyx_t_3;
11194 __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4);
11204 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 422, __pyx_L1_error)
11214 __pyx_t_2 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 423, __pyx_L1_error)
11215 __Pyx_GOTREF(__pyx_t_2);
11216 __pyx_v_obj = __pyx_t_2;
11226 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 424, __pyx_L1_error)
11236 __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 425, __pyx_L1_error)
11237 __Pyx_GOTREF(__pyx_t_2);
11238 __pyx_t_4 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_2, __pyx_v_obj);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 425, __pyx_L1_error)
11239 __Pyx_GOTREF(__pyx_t_4);
11240 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11241 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11261 __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 427, __pyx_L1_error)
11262 __Pyx_GOTREF(__pyx_t_4);
11263 if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(1, 427, __pyx_L1_error)
11264 __pyx_t_2 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((
struct __pyx_memoryview_obj *)__pyx_t_4), __pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 427, __pyx_L1_error)
11265 __Pyx_GOTREF(__pyx_t_2);
11266 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11267 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11289 __pyx_t_2 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 429, __pyx_L1_error)
11290 __Pyx_GOTREF(__pyx_t_2);
11291 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11307 __Pyx_XDECREF(__pyx_t_2);
11308 __Pyx_XDECREF(__pyx_t_3);
11309 __Pyx_XDECREF(__pyx_t_4);
11310 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11313 __Pyx_XDECREF(__pyx_v_have_slices);
11314 __Pyx_XDECREF(__pyx_v_obj);
11315 __Pyx_XDECREF(__pyx_v_index);
11316 __Pyx_TraceReturn(Py_None, 0);
11317 __Pyx_RefNannyFinishContext();
11329 static PyObject *__pyx_memoryview_is_slice(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
11330 PyObject *__pyx_r = NULL;
11331 __Pyx_TraceDeclarations
11332 __Pyx_RefNannyDeclarations
11335 PyObject *__pyx_t_3 = NULL;
11336 PyObject *__pyx_t_4 = NULL;
11337 PyObject *__pyx_t_5 = NULL;
11338 PyObject *__pyx_t_6 = NULL;
11339 PyObject *__pyx_t_7 = NULL;
11340 PyObject *__pyx_t_8 = NULL;
11342 int __pyx_lineno = 0;
11343 const char *__pyx_filename = NULL;
11344 int __pyx_clineno = 0;
11345 __Pyx_RefNannySetupContext(
"is_slice", 0);
11346 __Pyx_TraceCall(
"is_slice", __pyx_f[1], 431, 0, __PYX_ERR(1, 431, __pyx_L1_error));
11347 __Pyx_INCREF(__pyx_v_obj);
11356 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
11357 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
11368 __Pyx_PyThreadState_declare
11369 __Pyx_PyThreadState_assign
11370 __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
11371 __Pyx_XGOTREF(__pyx_t_3);
11372 __Pyx_XGOTREF(__pyx_t_4);
11373 __Pyx_XGOTREF(__pyx_t_5);
11383 __pyx_t_6 = __Pyx_PyInt_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS));
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 434, __pyx_L4_error)
11384 __Pyx_GOTREF(__pyx_t_6);
11393 __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 435, __pyx_L4_error)
11394 __Pyx_GOTREF(__pyx_t_7);
11403 __pyx_t_8 = PyTuple_New(3);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 434, __pyx_L4_error)
11404 __Pyx_GOTREF(__pyx_t_8);
11405 __Pyx_INCREF(__pyx_v_obj);
11406 __Pyx_GIVEREF(__pyx_v_obj);
11407 PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
11408 __Pyx_GIVEREF(__pyx_t_6);
11409 PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
11410 __Pyx_GIVEREF(__pyx_t_7);
11411 PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
11414 __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 434, __pyx_L4_error)
11415 __Pyx_GOTREF(__pyx_t_7);
11416 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11417 __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7);
11428 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
11429 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
11430 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
11431 goto __pyx_L9_try_end;
11433 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
11434 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
11435 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
11444 __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
11446 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
11447 if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(1, 436, __pyx_L6_except_error)
11448 __Pyx_GOTREF(__pyx_t_7);
11449 __Pyx_GOTREF(__pyx_t_8);
11450 __Pyx_GOTREF(__pyx_t_6);
11459 __Pyx_XDECREF(__pyx_r);
11460 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11461 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11462 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
11463 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11464 goto __pyx_L7_except_return;
11466 goto __pyx_L6_except_error;
11467 __pyx_L6_except_error:;
11476 __Pyx_XGIVEREF(__pyx_t_3);
11477 __Pyx_XGIVEREF(__pyx_t_4);
11478 __Pyx_XGIVEREF(__pyx_t_5);
11479 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
11480 goto __pyx_L1_error;
11481 __pyx_L7_except_return:;
11482 __Pyx_XGIVEREF(__pyx_t_3);
11483 __Pyx_XGIVEREF(__pyx_t_4);
11484 __Pyx_XGIVEREF(__pyx_t_5);
11485 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
11506 __Pyx_XDECREF(__pyx_r);
11507 __Pyx_INCREF(__pyx_v_obj);
11508 __pyx_r = __pyx_v_obj;
11521 __Pyx_XDECREF(__pyx_t_6);
11522 __Pyx_XDECREF(__pyx_t_7);
11523 __Pyx_XDECREF(__pyx_t_8);
11524 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
11527 __Pyx_XDECREF(__pyx_v_obj);
11528 __Pyx_XGIVEREF(__pyx_r);
11529 __Pyx_TraceReturn(__pyx_r, 0);
11530 __Pyx_RefNannyFinishContext();
11542 static PyObject *__pyx_memoryview_setitem_slice_assignment(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
11543 __Pyx_memviewslice __pyx_v_dst_slice;
11544 __Pyx_memviewslice __pyx_v_src_slice;
11545 PyObject *__pyx_r = NULL;
11546 __Pyx_TraceDeclarations
11547 __Pyx_RefNannyDeclarations
11548 __Pyx_memviewslice *__pyx_t_1;
11549 __Pyx_memviewslice *__pyx_t_2;
11550 PyObject *__pyx_t_3 = NULL;
11554 int __pyx_lineno = 0;
11555 const char *__pyx_filename = NULL;
11556 int __pyx_clineno = 0;
11557 __Pyx_RefNannySetupContext(
"setitem_slice_assignment", 0);
11558 __Pyx_TraceCall(
"setitem_slice_assignment", __pyx_f[1], 441, 0, __PYX_ERR(1, 441, __pyx_L1_error));
11567 if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(1, 445, __pyx_L1_error)
11568 __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((
struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice));
if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 445, __pyx_L1_error)
11577 if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(1, 446, __pyx_L1_error)
11578 __pyx_t_2 = __pyx_memoryview_get_slice_from_memoryview(((
struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice));
if (unlikely(__pyx_t_2 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 446, __pyx_L1_error)
11587 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 447, __pyx_L1_error)
11588 __Pyx_GOTREF(__pyx_t_3);
11589 __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3);
if (unlikely((__pyx_t_4 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 447, __pyx_L1_error)
11590 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11591 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 447, __pyx_L1_error)
11592 __Pyx_GOTREF(__pyx_t_3);
11593 __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3);
if (unlikely((__pyx_t_5 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 447, __pyx_L1_error)
11594 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11603 __pyx_t_6 = __pyx_memoryview_copy_contents((__pyx_t_1[0]), (__pyx_t_2[0]), __pyx_t_4, __pyx_t_5, __pyx_v_self->dtype_is_object);
if (unlikely(__pyx_t_6 == ((
int)-1))) __PYX_ERR(1, 445, __pyx_L1_error)
11614 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11617 __Pyx_XDECREF(__pyx_t_3);
11618 __Pyx_AddTraceback(
"View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
11621 __Pyx_XGIVEREF(__pyx_r);
11622 __Pyx_TraceReturn(__pyx_r, 0);
11623 __Pyx_RefNannyFinishContext();
11635 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(
struct __pyx_memoryview_obj *__pyx_v_self,
struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value) {
11636 int __pyx_v_array[0x80];
11638 void *__pyx_v_item;
11639 __Pyx_memviewslice *__pyx_v_dst_slice;
11640 __Pyx_memviewslice __pyx_v_tmp_slice;
11641 PyObject *__pyx_r = NULL;
11642 __Pyx_TraceDeclarations
11643 __Pyx_RefNannyDeclarations
11644 __Pyx_memviewslice *__pyx_t_1;
11646 PyObject *__pyx_t_3 = NULL;
11649 char const *__pyx_t_6;
11650 PyObject *__pyx_t_7 = NULL;
11651 PyObject *__pyx_t_8 = NULL;
11652 PyObject *__pyx_t_9 = NULL;
11653 PyObject *__pyx_t_10 = NULL;
11654 PyObject *__pyx_t_11 = NULL;
11655 PyObject *__pyx_t_12 = NULL;
11656 int __pyx_lineno = 0;
11657 const char *__pyx_filename = NULL;
11658 int __pyx_clineno = 0;
11659 __Pyx_RefNannySetupContext(
"setitem_slice_assign_scalar", 0);
11660 __Pyx_TraceCall(
"setitem_slice_assign_scalar", __pyx_f[1], 449, 0, __PYX_ERR(1, 449, __pyx_L1_error));
11669 __pyx_v_tmp = NULL;
11678 __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice));
if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 456, __pyx_L1_error)
11679 __pyx_v_dst_slice = __pyx_t_1;
11688 __pyx_t_2 = ((((size_t)__pyx_v_self->view.itemsize) > (
sizeof(__pyx_v_array))) != 0);
11698 __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
11707 __pyx_t_2 = ((__pyx_v_tmp == NULL) != 0);
11708 if (unlikely(__pyx_t_2)) {
11717 PyErr_NoMemory(); __PYX_ERR(1, 461, __pyx_L1_error)
11735 __pyx_v_item = __pyx_v_tmp;
11755 __pyx_v_item = ((
void *)__pyx_v_array);
11775 __pyx_t_2 = (__pyx_v_self->dtype_is_object != 0);
11785 (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
11805 __pyx_t_3 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((
char *)__pyx_v_item), __pyx_v_value);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 470, __pyx_L6_error)
11806 __Pyx_GOTREF(__pyx_t_3);
11807 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11818 __pyx_t_2 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
11828 __pyx_t_3 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 475, __pyx_L6_error)
11829 __Pyx_GOTREF(__pyx_t_3);
11830 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11848 __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object);
11860 PyMem_Free(__pyx_v_tmp);
11865 __Pyx_PyThreadState_declare
11866 __Pyx_PyThreadState_assign
11867 __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
11868 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
11869 if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
11870 if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
11871 __Pyx_XGOTREF(__pyx_t_7);
11872 __Pyx_XGOTREF(__pyx_t_8);
11873 __Pyx_XGOTREF(__pyx_t_9);
11874 __Pyx_XGOTREF(__pyx_t_10);
11875 __Pyx_XGOTREF(__pyx_t_11);
11876 __Pyx_XGOTREF(__pyx_t_12);
11877 __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename;
11879 PyMem_Free(__pyx_v_tmp);
11881 if (PY_MAJOR_VERSION >= 3) {
11882 __Pyx_XGIVEREF(__pyx_t_10);
11883 __Pyx_XGIVEREF(__pyx_t_11);
11884 __Pyx_XGIVEREF(__pyx_t_12);
11885 __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
11887 __Pyx_XGIVEREF(__pyx_t_7);
11888 __Pyx_XGIVEREF(__pyx_t_8);
11889 __Pyx_XGIVEREF(__pyx_t_9);
11890 __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
11891 __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
11892 __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6;
11893 goto __pyx_L1_error;
11907 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11910 __Pyx_XDECREF(__pyx_t_3);
11911 __Pyx_AddTraceback(
"View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
11914 __Pyx_XGIVEREF(__pyx_r);
11915 __Pyx_TraceReturn(__pyx_r, 0);
11916 __Pyx_RefNannyFinishContext();
11928 static PyObject *__pyx_memoryview_setitem_indexed(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
11929 char *__pyx_v_itemp;
11930 PyObject *__pyx_r = NULL;
11931 __Pyx_TraceDeclarations
11932 __Pyx_RefNannyDeclarations
11934 PyObject *__pyx_t_2 = NULL;
11935 int __pyx_lineno = 0;
11936 const char *__pyx_filename = NULL;
11937 int __pyx_clineno = 0;
11938 __Pyx_RefNannySetupContext(
"setitem_indexed", 0);
11939 __Pyx_TraceCall(
"setitem_indexed", __pyx_f[1], 481, 0, __PYX_ERR(1, 481, __pyx_L1_error));
11948 __pyx_t_1 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index);
if (unlikely(__pyx_t_1 == ((
char *)NULL))) __PYX_ERR(1, 482, __pyx_L1_error)
11949 __pyx_v_itemp = __pyx_t_1;
11958 __pyx_t_2 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 483, __pyx_L1_error)
11959 __Pyx_GOTREF(__pyx_t_2);
11960 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11971 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11974 __Pyx_XDECREF(__pyx_t_2);
11975 __Pyx_AddTraceback(
"View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
11978 __Pyx_XGIVEREF(__pyx_r);
11979 __Pyx_TraceReturn(__pyx_r, 0);
11980 __Pyx_RefNannyFinishContext();
11992 static PyObject *__pyx_memoryview_convert_item_to_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp) {
11993 PyObject *__pyx_v_struct = NULL;
11994 PyObject *__pyx_v_bytesitem = 0;
11995 PyObject *__pyx_v_result = NULL;
11996 PyObject *__pyx_r = NULL;
11997 __Pyx_TraceDeclarations
11998 __Pyx_RefNannyDeclarations
11999 PyObject *__pyx_t_1 = NULL;
12000 PyObject *__pyx_t_2 = NULL;
12001 PyObject *__pyx_t_3 = NULL;
12002 PyObject *__pyx_t_4 = NULL;
12003 PyObject *__pyx_t_5 = NULL;
12004 PyObject *__pyx_t_6 = NULL;
12005 PyObject *__pyx_t_7 = NULL;
12007 PyObject *__pyx_t_9 = NULL;
12010 int __pyx_lineno = 0;
12011 const char *__pyx_filename = NULL;
12012 int __pyx_clineno = 0;
12013 __Pyx_RefNannySetupContext(
"convert_item_to_object", 0);
12014 __Pyx_TraceCall(
"convert_item_to_object", __pyx_f[1], 485, 0, __PYX_ERR(1, 485, __pyx_L1_error));
12023 __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 488, __pyx_L1_error)
12024 __Pyx_GOTREF(__pyx_t_1);
12025 __pyx_v_struct = __pyx_t_1;
12035 __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 491, __pyx_L1_error)
12036 __Pyx_GOTREF(__pyx_t_1);
12037 __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
12048 __Pyx_PyThreadState_declare
12049 __Pyx_PyThreadState_assign
12050 __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
12051 __Pyx_XGOTREF(__pyx_t_2);
12052 __Pyx_XGOTREF(__pyx_t_3);
12053 __Pyx_XGOTREF(__pyx_t_4);
12063 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 493, __pyx_L3_error)
12064 __Pyx_GOTREF(__pyx_t_5);
12065 __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 493, __pyx_L3_error)
12066 __Pyx_GOTREF(__pyx_t_6);
12069 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
12070 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
12071 if (likely(__pyx_t_7)) {
12072 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
12073 __Pyx_INCREF(__pyx_t_7);
12074 __Pyx_INCREF(
function);
12075 __Pyx_DECREF_SET(__pyx_t_5,
function);
12079 #if CYTHON_FAST_PYCALL
12080 if (PyFunction_Check(__pyx_t_5)) {
12081 PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
12082 __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L3_error)
12083 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12084 __Pyx_GOTREF(__pyx_t_1);
12085 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12088 #if CYTHON_FAST_PYCCALL
12089 if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
12090 PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
12091 __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L3_error)
12092 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12093 __Pyx_GOTREF(__pyx_t_1);
12094 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12098 __pyx_t_9 = PyTuple_New(2+__pyx_t_8);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 493, __pyx_L3_error)
12099 __Pyx_GOTREF(__pyx_t_9);
12101 __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
12103 __Pyx_GIVEREF(__pyx_t_6);
12104 PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
12105 __Pyx_INCREF(__pyx_v_bytesitem);
12106 __Pyx_GIVEREF(__pyx_v_bytesitem);
12107 PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem);
12109 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L3_error)
12110 __Pyx_GOTREF(__pyx_t_1);
12111 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
12113 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12114 __pyx_v_result = __pyx_t_1;
12134 __pyx_t_10 = strlen(__pyx_v_self->view.format);
12135 __pyx_t_11 = ((__pyx_t_10 == 1) != 0);
12145 __Pyx_XDECREF(__pyx_r);
12146 __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 498, __pyx_L5_except_error)
12147 __Pyx_GOTREF(__pyx_t_1);
12148 __pyx_r = __pyx_t_1;
12150 goto __pyx_L6_except_return;
12168 __Pyx_XDECREF(__pyx_r);
12169 __Pyx_INCREF(__pyx_v_result);
12170 __pyx_r = __pyx_v_result;
12171 goto __pyx_L6_except_return;
12174 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
12175 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12176 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
12177 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12178 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
12187 __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9);
12188 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 494, __pyx_L5_except_error)
12189 __Pyx_GOTREF(__pyx_t_6);
12190 __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_6);
12191 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12192 __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_9);
12193 __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_9 = 0;
12195 __Pyx_AddTraceback(
"View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
12196 if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(1, 494, __pyx_L5_except_error)
12197 __Pyx_GOTREF(__pyx_t_9);
12198 __Pyx_GOTREF(__pyx_t_5);
12199 __Pyx_GOTREF(__pyx_t_1);
12208 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__25, NULL);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 495, __pyx_L5_except_error)
12209 __Pyx_GOTREF(__pyx_t_6);
12210 __Pyx_Raise(__pyx_t_6, 0, 0, 0);
12211 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12212 __PYX_ERR(1, 495, __pyx_L5_except_error)
12214 goto __pyx_L5_except_error;
12215 __pyx_L5_except_error:;
12224 __Pyx_XGIVEREF(__pyx_t_2);
12225 __Pyx_XGIVEREF(__pyx_t_3);
12226 __Pyx_XGIVEREF(__pyx_t_4);
12227 __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
12228 goto __pyx_L1_error;
12229 __pyx_L6_except_return:;
12230 __Pyx_XGIVEREF(__pyx_t_2);
12231 __Pyx_XGIVEREF(__pyx_t_3);
12232 __Pyx_XGIVEREF(__pyx_t_4);
12233 __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
12247 __Pyx_XDECREF(__pyx_t_1);
12248 __Pyx_XDECREF(__pyx_t_5);
12249 __Pyx_XDECREF(__pyx_t_6);
12250 __Pyx_XDECREF(__pyx_t_7);
12251 __Pyx_XDECREF(__pyx_t_9);
12252 __Pyx_AddTraceback(
"View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
12255 __Pyx_XDECREF(__pyx_v_struct);
12256 __Pyx_XDECREF(__pyx_v_bytesitem);
12257 __Pyx_XDECREF(__pyx_v_result);
12258 __Pyx_XGIVEREF(__pyx_r);
12259 __Pyx_TraceReturn(__pyx_r, 0);
12260 __Pyx_RefNannyFinishContext();
12272 static PyObject *__pyx_memoryview_assign_item_from_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value) {
12273 PyObject *__pyx_v_struct = NULL;
12275 PyObject *__pyx_v_bytesvalue = 0;
12276 Py_ssize_t __pyx_v_i;
12277 PyObject *__pyx_r = NULL;
12278 __Pyx_TraceDeclarations
12279 __Pyx_RefNannyDeclarations
12280 PyObject *__pyx_t_1 = NULL;
12283 PyObject *__pyx_t_4 = NULL;
12284 PyObject *__pyx_t_5 = NULL;
12285 PyObject *__pyx_t_6 = NULL;
12287 PyObject *__pyx_t_8 = NULL;
12288 Py_ssize_t __pyx_t_9;
12289 PyObject *__pyx_t_10 = NULL;
12294 int __pyx_lineno = 0;
12295 const char *__pyx_filename = NULL;
12296 int __pyx_clineno = 0;
12297 __Pyx_RefNannySetupContext(
"assign_item_from_object", 0);
12298 __Pyx_TraceCall(
"assign_item_from_object", __pyx_f[1], 501, 0, __PYX_ERR(1, 501, __pyx_L1_error));
12307 __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 504, __pyx_L1_error)
12308 __Pyx_GOTREF(__pyx_t_1);
12309 __pyx_v_struct = __pyx_t_1;
12319 __pyx_t_2 = PyTuple_Check(__pyx_v_value);
12320 __pyx_t_3 = (__pyx_t_2 != 0);
12330 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 510, __pyx_L1_error)
12331 __Pyx_GOTREF(__pyx_t_1);
12332 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 510, __pyx_L1_error)
12333 __Pyx_GOTREF(__pyx_t_4);
12334 __pyx_t_5 = PyTuple_New(1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 510, __pyx_L1_error)
12335 __Pyx_GOTREF(__pyx_t_5);
12336 __Pyx_GIVEREF(__pyx_t_4);
12337 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
12339 __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 510, __pyx_L1_error)
12340 __Pyx_GOTREF(__pyx_t_4);
12341 __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 510, __pyx_L1_error)
12342 __Pyx_GOTREF(__pyx_t_6);
12343 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12344 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12345 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 510, __pyx_L1_error)
12346 __Pyx_GOTREF(__pyx_t_4);
12347 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12348 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12349 if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 510, __pyx_L1_error)
12350 __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
12371 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 512, __pyx_L1_error)
12372 __Pyx_GOTREF(__pyx_t_6);
12373 __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 512, __pyx_L1_error)
12374 __Pyx_GOTREF(__pyx_t_1);
12377 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
12378 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
12379 if (likely(__pyx_t_5)) {
12380 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
12381 __Pyx_INCREF(__pyx_t_5);
12382 __Pyx_INCREF(
function);
12383 __Pyx_DECREF_SET(__pyx_t_6,
function);
12387 #if CYTHON_FAST_PYCALL
12388 if (PyFunction_Check(__pyx_t_6)) {
12389 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
12390 __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
12391 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12392 __Pyx_GOTREF(__pyx_t_4);
12393 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12396 #if CYTHON_FAST_PYCCALL
12397 if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
12398 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
12399 __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
12400 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12401 __Pyx_GOTREF(__pyx_t_4);
12402 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12406 __pyx_t_8 = PyTuple_New(2+__pyx_t_7);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 512, __pyx_L1_error)
12407 __Pyx_GOTREF(__pyx_t_8);
12409 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
12411 __Pyx_GIVEREF(__pyx_t_1);
12412 PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1);
12413 __Pyx_INCREF(__pyx_v_value);
12414 __Pyx_GIVEREF(__pyx_v_value);
12415 PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value);
12417 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
12418 __Pyx_GOTREF(__pyx_t_4);
12419 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12421 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12422 if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 512, __pyx_L1_error)
12423 __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
12436 if (unlikely(__pyx_v_bytesvalue == Py_None)) {
12437 PyErr_SetString(PyExc_TypeError,
"'NoneType' is not iterable");
12438 __PYX_ERR(1, 514, __pyx_L1_error)
12440 __Pyx_INCREF(__pyx_v_bytesvalue);
12441 __pyx_t_10 = __pyx_v_bytesvalue;
12442 __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10);
12443 __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10));
12444 for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
12445 __pyx_t_11 = __pyx_t_14;
12446 __pyx_v_c = (__pyx_t_11[0]);
12455 __pyx_v_i = __pyx_t_9;
12464 __pyx_t_9 = (__pyx_t_9 + 1);
12473 (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
12475 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
12486 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12489 __Pyx_XDECREF(__pyx_t_1);
12490 __Pyx_XDECREF(__pyx_t_4);
12491 __Pyx_XDECREF(__pyx_t_5);
12492 __Pyx_XDECREF(__pyx_t_6);
12493 __Pyx_XDECREF(__pyx_t_8);
12494 __Pyx_XDECREF(__pyx_t_10);
12495 __Pyx_AddTraceback(
"View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
12498 __Pyx_XDECREF(__pyx_v_struct);
12499 __Pyx_XDECREF(__pyx_v_bytesvalue);
12500 __Pyx_XGIVEREF(__pyx_r);
12501 __Pyx_TraceReturn(__pyx_r, 0);
12502 __Pyx_RefNannyFinishContext();
12515 static CYTHON_UNUSED
int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
12516 static CYTHON_UNUSED
int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
12518 __Pyx_RefNannyDeclarations
12519 __Pyx_RefNannySetupContext(
"__getbuffer__ (wrapper)", 0);
12520 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((
int)__pyx_v_flags));
12523 __Pyx_RefNannyFinishContext();
12527 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(
struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
12529 __Pyx_TraceDeclarations
12530 __Pyx_RefNannyDeclarations
12533 PyObject *__pyx_t_3 = NULL;
12534 Py_ssize_t *__pyx_t_4;
12538 Py_ssize_t __pyx_t_8;
12539 int __pyx_lineno = 0;
12540 const char *__pyx_filename = NULL;
12541 int __pyx_clineno = 0;
12542 if (__pyx_v_info == NULL) {
12543 PyErr_SetString(PyExc_BufferError,
"PyObject_GetBuffer: view==NULL argument is obsolete");
12546 __Pyx_RefNannySetupContext(
"__getbuffer__", 0);
12547 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
12548 __Pyx_GIVEREF(__pyx_v_info->obj);
12549 __Pyx_TraceCall(
"__getbuffer__", __pyx_f[1], 518, 0, __PYX_ERR(1, 518, __pyx_L1_error));
12558 __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
12561 __pyx_t_1 = __pyx_t_2;
12562 goto __pyx_L4_bool_binop_done;
12564 __pyx_t_2 = (__pyx_v_self->view.readonly != 0);
12565 __pyx_t_1 = __pyx_t_2;
12566 __pyx_L4_bool_binop_done:;
12567 if (unlikely(__pyx_t_1)) {
12576 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__26, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 520, __pyx_L1_error)
12577 __Pyx_GOTREF(__pyx_t_3);
12578 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
12579 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12580 __PYX_ERR(1, 520, __pyx_L1_error)
12598 __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
12608 __pyx_t_4 = __pyx_v_self->view.shape;
12609 __pyx_v_info->shape = __pyx_t_4;
12629 __pyx_v_info->shape = NULL;
12640 __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
12650 __pyx_t_4 = __pyx_v_self->view.strides;
12651 __pyx_v_info->strides = __pyx_t_4;
12671 __pyx_v_info->strides = NULL;
12682 __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
12692 __pyx_t_4 = __pyx_v_self->view.suboffsets;
12693 __pyx_v_info->suboffsets = __pyx_t_4;
12713 __pyx_v_info->suboffsets = NULL;
12724 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
12734 __pyx_t_5 = __pyx_v_self->view.format;
12735 __pyx_v_info->format = __pyx_t_5;
12755 __pyx_v_info->format = NULL;
12766 __pyx_t_6 = __pyx_v_self->view.buf;
12767 __pyx_v_info->buf = __pyx_t_6;
12776 __pyx_t_7 = __pyx_v_self->view.ndim;
12777 __pyx_v_info->ndim = __pyx_t_7;
12786 __pyx_t_8 = __pyx_v_self->view.itemsize;
12787 __pyx_v_info->itemsize = __pyx_t_8;
12796 __pyx_t_8 = __pyx_v_self->view.len;
12797 __pyx_v_info->len = __pyx_t_8;
12806 __pyx_t_1 = __pyx_v_self->view.readonly;
12807 __pyx_v_info->readonly = __pyx_t_1;
12816 __Pyx_INCREF(((PyObject *)__pyx_v_self));
12817 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
12818 __Pyx_GOTREF(__pyx_v_info->obj);
12819 __Pyx_DECREF(__pyx_v_info->obj);
12820 __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
12834 __Pyx_XDECREF(__pyx_t_3);
12835 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12837 if (__pyx_v_info->obj != NULL) {
12838 __Pyx_GOTREF(__pyx_v_info->obj);
12839 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
12843 if (__pyx_v_info->obj == Py_None) {
12844 __Pyx_GOTREF(__pyx_v_info->obj);
12845 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
12848 __Pyx_TraceReturn(Py_None, 0);
12849 __Pyx_RefNannyFinishContext();
12862 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self);
12863 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
12864 PyObject *__pyx_r = 0;
12865 __Pyx_RefNannyDeclarations
12866 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
12867 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
12870 __Pyx_RefNannyFinishContext();
12874 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
12875 struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
12876 PyObject *__pyx_r = NULL;
12877 __Pyx_TraceDeclarations
12878 __Pyx_RefNannyDeclarations
12879 PyObject *__pyx_t_1 = NULL;
12881 int __pyx_lineno = 0;
12882 const char *__pyx_filename = NULL;
12883 int __pyx_clineno = 0;
12884 __Pyx_RefNannySetupContext(
"__get__", 0);
12885 __Pyx_TraceCall(
"__get__", __pyx_f[1], 553, 0, __PYX_ERR(1, 553, __pyx_L1_error));
12894 __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 554, __pyx_L1_error)
12895 __Pyx_GOTREF(__pyx_t_1);
12896 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(1, 554, __pyx_L1_error)
12897 __pyx_v_result = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_1);
12907 __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice));
if (unlikely(__pyx_t_2 == ((
int)0))) __PYX_ERR(1, 555, __pyx_L1_error)
12916 __Pyx_XDECREF(__pyx_r);
12917 __Pyx_INCREF(((PyObject *)__pyx_v_result));
12918 __pyx_r = ((PyObject *)__pyx_v_result);
12931 __Pyx_XDECREF(__pyx_t_1);
12932 __Pyx_AddTraceback(
"View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12935 __Pyx_XDECREF((PyObject *)__pyx_v_result);
12936 __Pyx_XGIVEREF(__pyx_r);
12937 __Pyx_TraceReturn(__pyx_r, 0);
12938 __Pyx_RefNannyFinishContext();
12951 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self);
12952 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
12953 PyObject *__pyx_r = 0;
12954 __Pyx_RefNannyDeclarations
12955 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
12956 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
12959 __Pyx_RefNannyFinishContext();
12963 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
12964 PyObject *__pyx_r = NULL;
12965 __Pyx_TraceDeclarations
12966 __Pyx_RefNannyDeclarations
12967 int __pyx_lineno = 0;
12968 const char *__pyx_filename = NULL;
12969 int __pyx_clineno = 0;
12970 __Pyx_RefNannySetupContext(
"__get__", 0);
12971 __Pyx_TraceCall(
"__get__", __pyx_f[1], 559, 0, __PYX_ERR(1, 559, __pyx_L1_error));
12980 __Pyx_XDECREF(__pyx_r);
12981 __Pyx_INCREF(__pyx_v_self->obj);
12982 __pyx_r = __pyx_v_self->obj;
12995 __Pyx_AddTraceback(
"View.MemoryView.memoryview.base.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12998 __Pyx_XGIVEREF(__pyx_r);
12999 __Pyx_TraceReturn(__pyx_r, 0);
13000 __Pyx_RefNannyFinishContext();
13013 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self);
13014 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
13015 PyObject *__pyx_r = 0;
13016 __Pyx_RefNannyDeclarations
13017 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
13018 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13021 __Pyx_RefNannyFinishContext();
13025 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13026 Py_ssize_t __pyx_v_length;
13027 PyObject *__pyx_r = NULL;
13028 __Pyx_TraceDeclarations
13029 __Pyx_RefNannyDeclarations
13030 PyObject *__pyx_t_1 = NULL;
13031 Py_ssize_t *__pyx_t_2;
13032 Py_ssize_t *__pyx_t_3;
13033 Py_ssize_t *__pyx_t_4;
13034 PyObject *__pyx_t_5 = NULL;
13035 int __pyx_lineno = 0;
13036 const char *__pyx_filename = NULL;
13037 int __pyx_clineno = 0;
13038 __Pyx_RefNannySetupContext(
"__get__", 0);
13039 __Pyx_TraceCall(
"__get__", __pyx_f[1], 563, 0, __PYX_ERR(1, 563, __pyx_L1_error));
13048 __Pyx_XDECREF(__pyx_r);
13049 __pyx_t_1 = PyList_New(0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 564, __pyx_L1_error)
13050 __Pyx_GOTREF(__pyx_t_1);
13051 __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
13052 for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
13053 __pyx_t_2 = __pyx_t_4;
13054 __pyx_v_length = (__pyx_t_2[0]);
13055 __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 564, __pyx_L1_error)
13056 __Pyx_GOTREF(__pyx_t_5);
13057 if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 564, __pyx_L1_error)
13058 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13060 __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1));
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 564, __pyx_L1_error)
13061 __Pyx_GOTREF(__pyx_t_5);
13062 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13063 __pyx_r = __pyx_t_5;
13077 __Pyx_XDECREF(__pyx_t_1);
13078 __Pyx_XDECREF(__pyx_t_5);
13079 __Pyx_AddTraceback(
"View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13082 __Pyx_XGIVEREF(__pyx_r);
13083 __Pyx_TraceReturn(__pyx_r, 0);
13084 __Pyx_RefNannyFinishContext();
13097 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self);
13098 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
13099 PyObject *__pyx_r = 0;
13100 __Pyx_RefNannyDeclarations
13101 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
13102 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13105 __Pyx_RefNannyFinishContext();
13109 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13110 Py_ssize_t __pyx_v_stride;
13111 PyObject *__pyx_r = NULL;
13112 __Pyx_TraceDeclarations
13113 __Pyx_RefNannyDeclarations
13115 PyObject *__pyx_t_2 = NULL;
13116 Py_ssize_t *__pyx_t_3;
13117 Py_ssize_t *__pyx_t_4;
13118 Py_ssize_t *__pyx_t_5;
13119 PyObject *__pyx_t_6 = NULL;
13120 int __pyx_lineno = 0;
13121 const char *__pyx_filename = NULL;
13122 int __pyx_clineno = 0;
13123 __Pyx_RefNannySetupContext(
"__get__", 0);
13124 __Pyx_TraceCall(
"__get__", __pyx_f[1], 567, 0, __PYX_ERR(1, 567, __pyx_L1_error));
13133 __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0);
13134 if (unlikely(__pyx_t_1)) {
13143 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__27, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 570, __pyx_L1_error)
13144 __Pyx_GOTREF(__pyx_t_2);
13145 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
13146 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13147 __PYX_ERR(1, 570, __pyx_L1_error)
13165 __Pyx_XDECREF(__pyx_r);
13166 __pyx_t_2 = PyList_New(0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 572, __pyx_L1_error)
13167 __Pyx_GOTREF(__pyx_t_2);
13168 __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
13169 for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
13170 __pyx_t_3 = __pyx_t_5;
13171 __pyx_v_stride = (__pyx_t_3[0]);
13172 __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 572, __pyx_L1_error)
13173 __Pyx_GOTREF(__pyx_t_6);
13174 if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 572, __pyx_L1_error)
13175 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13177 __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2));
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 572, __pyx_L1_error)
13178 __Pyx_GOTREF(__pyx_t_6);
13179 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13180 __pyx_r = __pyx_t_6;
13194 __Pyx_XDECREF(__pyx_t_2);
13195 __Pyx_XDECREF(__pyx_t_6);
13196 __Pyx_AddTraceback(
"View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13199 __Pyx_XGIVEREF(__pyx_r);
13200 __Pyx_TraceReturn(__pyx_r, 0);
13201 __Pyx_RefNannyFinishContext();
13214 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self);
13215 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
13216 PyObject *__pyx_r = 0;
13217 __Pyx_RefNannyDeclarations
13218 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
13219 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13222 __Pyx_RefNannyFinishContext();
13226 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13227 Py_ssize_t __pyx_v_suboffset;
13228 PyObject *__pyx_r = NULL;
13229 __Pyx_TraceDeclarations
13230 __Pyx_RefNannyDeclarations
13232 PyObject *__pyx_t_2 = NULL;
13233 PyObject *__pyx_t_3 = NULL;
13234 Py_ssize_t *__pyx_t_4;
13235 Py_ssize_t *__pyx_t_5;
13236 Py_ssize_t *__pyx_t_6;
13237 int __pyx_lineno = 0;
13238 const char *__pyx_filename = NULL;
13239 int __pyx_clineno = 0;
13240 __Pyx_RefNannySetupContext(
"__get__", 0);
13241 __Pyx_TraceCall(
"__get__", __pyx_f[1], 575, 0, __PYX_ERR(1, 575, __pyx_L1_error));
13250 __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0);
13260 __Pyx_XDECREF(__pyx_r);
13261 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 577, __pyx_L1_error)
13262 __Pyx_GOTREF(__pyx_t_2);
13263 __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__28, __pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 577, __pyx_L1_error)
13264 __Pyx_GOTREF(__pyx_t_3);
13265 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13266 __pyx_r = __pyx_t_3;
13286 __Pyx_XDECREF(__pyx_r);
13287 __pyx_t_3 = PyList_New(0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 579, __pyx_L1_error)
13288 __Pyx_GOTREF(__pyx_t_3);
13289 __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
13290 for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
13291 __pyx_t_4 = __pyx_t_6;
13292 __pyx_v_suboffset = (__pyx_t_4[0]);
13293 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 579, __pyx_L1_error)
13294 __Pyx_GOTREF(__pyx_t_2);
13295 if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(1, 579, __pyx_L1_error)
13296 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13298 __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 579, __pyx_L1_error)
13299 __Pyx_GOTREF(__pyx_t_2);
13300 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13301 __pyx_r = __pyx_t_2;
13315 __Pyx_XDECREF(__pyx_t_2);
13316 __Pyx_XDECREF(__pyx_t_3);
13317 __Pyx_AddTraceback(
"View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13320 __Pyx_XGIVEREF(__pyx_r);
13321 __Pyx_TraceReturn(__pyx_r, 0);
13322 __Pyx_RefNannyFinishContext();
13335 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self);
13336 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
13337 PyObject *__pyx_r = 0;
13338 __Pyx_RefNannyDeclarations
13339 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
13340 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13343 __Pyx_RefNannyFinishContext();
13347 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13348 PyObject *__pyx_r = NULL;
13349 __Pyx_TraceDeclarations
13350 __Pyx_RefNannyDeclarations
13351 PyObject *__pyx_t_1 = NULL;
13352 int __pyx_lineno = 0;
13353 const char *__pyx_filename = NULL;
13354 int __pyx_clineno = 0;
13355 __Pyx_RefNannySetupContext(
"__get__", 0);
13356 __Pyx_TraceCall(
"__get__", __pyx_f[1], 582, 0, __PYX_ERR(1, 582, __pyx_L1_error));
13365 __Pyx_XDECREF(__pyx_r);
13366 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 583, __pyx_L1_error)
13367 __Pyx_GOTREF(__pyx_t_1);
13368 __pyx_r = __pyx_t_1;
13382 __Pyx_XDECREF(__pyx_t_1);
13383 __Pyx_AddTraceback(
"View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13386 __Pyx_XGIVEREF(__pyx_r);
13387 __Pyx_TraceReturn(__pyx_r, 0);
13388 __Pyx_RefNannyFinishContext();
13401 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self);
13402 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
13403 PyObject *__pyx_r = 0;
13404 __Pyx_RefNannyDeclarations
13405 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
13406 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13409 __Pyx_RefNannyFinishContext();
13413 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13414 PyObject *__pyx_r = NULL;
13415 __Pyx_TraceDeclarations
13416 __Pyx_RefNannyDeclarations
13417 PyObject *__pyx_t_1 = NULL;
13418 int __pyx_lineno = 0;
13419 const char *__pyx_filename = NULL;
13420 int __pyx_clineno = 0;
13421 __Pyx_RefNannySetupContext(
"__get__", 0);
13422 __Pyx_TraceCall(
"__get__", __pyx_f[1], 586, 0, __PYX_ERR(1, 586, __pyx_L1_error));
13431 __Pyx_XDECREF(__pyx_r);
13432 __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 587, __pyx_L1_error)
13433 __Pyx_GOTREF(__pyx_t_1);
13434 __pyx_r = __pyx_t_1;
13448 __Pyx_XDECREF(__pyx_t_1);
13449 __Pyx_AddTraceback(
"View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13452 __Pyx_XGIVEREF(__pyx_r);
13453 __Pyx_TraceReturn(__pyx_r, 0);
13454 __Pyx_RefNannyFinishContext();
13467 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self);
13468 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
13469 PyObject *__pyx_r = 0;
13470 __Pyx_RefNannyDeclarations
13471 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
13472 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13475 __Pyx_RefNannyFinishContext();
13479 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13480 PyObject *__pyx_r = NULL;
13481 __Pyx_TraceDeclarations
13482 __Pyx_RefNannyDeclarations
13483 PyObject *__pyx_t_1 = NULL;
13484 PyObject *__pyx_t_2 = NULL;
13485 PyObject *__pyx_t_3 = NULL;
13486 int __pyx_lineno = 0;
13487 const char *__pyx_filename = NULL;
13488 int __pyx_clineno = 0;
13489 __Pyx_RefNannySetupContext(
"__get__", 0);
13490 __Pyx_TraceCall(
"__get__", __pyx_f[1], 590, 0, __PYX_ERR(1, 590, __pyx_L1_error));
13499 __Pyx_XDECREF(__pyx_r);
13500 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 591, __pyx_L1_error)
13501 __Pyx_GOTREF(__pyx_t_1);
13502 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 591, __pyx_L1_error)
13503 __Pyx_GOTREF(__pyx_t_2);
13504 __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 591, __pyx_L1_error)
13505 __Pyx_GOTREF(__pyx_t_3);
13506 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13507 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13508 __pyx_r = __pyx_t_3;
13522 __Pyx_XDECREF(__pyx_t_1);
13523 __Pyx_XDECREF(__pyx_t_2);
13524 __Pyx_XDECREF(__pyx_t_3);
13525 __Pyx_AddTraceback(
"View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13528 __Pyx_XGIVEREF(__pyx_r);
13529 __Pyx_TraceReturn(__pyx_r, 0);
13530 __Pyx_RefNannyFinishContext();
13543 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self);
13544 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
13545 PyObject *__pyx_r = 0;
13546 __Pyx_RefNannyDeclarations
13547 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
13548 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13551 __Pyx_RefNannyFinishContext();
13555 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13556 PyObject *__pyx_v_result = NULL;
13557 PyObject *__pyx_v_length = NULL;
13558 PyObject *__pyx_r = NULL;
13559 __Pyx_TraceDeclarations
13560 __Pyx_RefNannyDeclarations
13563 Py_ssize_t *__pyx_t_3;
13564 Py_ssize_t *__pyx_t_4;
13565 Py_ssize_t *__pyx_t_5;
13566 PyObject *__pyx_t_6 = NULL;
13567 int __pyx_lineno = 0;
13568 const char *__pyx_filename = NULL;
13569 int __pyx_clineno = 0;
13570 __Pyx_RefNannySetupContext(
"__get__", 0);
13571 __Pyx_TraceCall(
"__get__", __pyx_f[1], 594, 0, __PYX_ERR(1, 594, __pyx_L1_error));
13580 __pyx_t_1 = (__pyx_v_self->_size == Py_None);
13581 __pyx_t_2 = (__pyx_t_1 != 0);
13591 __Pyx_INCREF(__pyx_int_1);
13592 __pyx_v_result = __pyx_int_1;
13601 __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
13602 for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
13603 __pyx_t_3 = __pyx_t_5;
13604 __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0]));
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 598, __pyx_L1_error)
13605 __Pyx_GOTREF(__pyx_t_6);
13606 __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6);
13616 __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 599, __pyx_L1_error)
13617 __Pyx_GOTREF(__pyx_t_6);
13618 __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6);
13629 __Pyx_INCREF(__pyx_v_result);
13630 __Pyx_GIVEREF(__pyx_v_result);
13631 __Pyx_GOTREF(__pyx_v_self->_size);
13632 __Pyx_DECREF(__pyx_v_self->_size);
13633 __pyx_v_self->_size = __pyx_v_result;
13651 __Pyx_XDECREF(__pyx_r);
13652 __Pyx_INCREF(__pyx_v_self->_size);
13653 __pyx_r = __pyx_v_self->_size;
13666 __Pyx_XDECREF(__pyx_t_6);
13667 __Pyx_AddTraceback(
"View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13670 __Pyx_XDECREF(__pyx_v_result);
13671 __Pyx_XDECREF(__pyx_v_length);
13672 __Pyx_XGIVEREF(__pyx_r);
13673 __Pyx_TraceReturn(__pyx_r, 0);
13674 __Pyx_RefNannyFinishContext();
13687 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self);
13688 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
13689 Py_ssize_t __pyx_r;
13690 __Pyx_RefNannyDeclarations
13691 __Pyx_RefNannySetupContext(
"__len__ (wrapper)", 0);
13692 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13695 __Pyx_RefNannyFinishContext();
13699 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13700 Py_ssize_t __pyx_r;
13701 __Pyx_TraceDeclarations
13702 __Pyx_RefNannyDeclarations
13704 int __pyx_lineno = 0;
13705 const char *__pyx_filename = NULL;
13706 int __pyx_clineno = 0;
13707 __Pyx_RefNannySetupContext(
"__len__", 0);
13708 __Pyx_TraceCall(
"__len__", __pyx_f[1], 605, 0, __PYX_ERR(1, 605, __pyx_L1_error));
13717 __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
13727 __pyx_r = (__pyx_v_self->view.shape[0]);
13759 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13762 __Pyx_TraceReturn(Py_None, 0);
13763 __Pyx_RefNannyFinishContext();
13776 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self);
13777 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
13778 PyObject *__pyx_r = 0;
13779 __Pyx_RefNannyDeclarations
13780 __Pyx_RefNannySetupContext(
"__repr__ (wrapper)", 0);
13781 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13784 __Pyx_RefNannyFinishContext();
13788 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13789 PyObject *__pyx_r = NULL;
13790 __Pyx_TraceDeclarations
13791 __Pyx_RefNannyDeclarations
13792 PyObject *__pyx_t_1 = NULL;
13793 PyObject *__pyx_t_2 = NULL;
13794 PyObject *__pyx_t_3 = NULL;
13795 int __pyx_lineno = 0;
13796 const char *__pyx_filename = NULL;
13797 int __pyx_clineno = 0;
13798 __Pyx_RefNannySetupContext(
"__repr__", 0);
13799 __Pyx_TraceCall(
"__repr__", __pyx_f[1], 611, 0, __PYX_ERR(1, 611, __pyx_L1_error));
13808 __Pyx_XDECREF(__pyx_r);
13809 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 612, __pyx_L1_error)
13810 __Pyx_GOTREF(__pyx_t_1);
13811 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 612, __pyx_L1_error)
13812 __Pyx_GOTREF(__pyx_t_2);
13813 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13814 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 612, __pyx_L1_error)
13815 __Pyx_GOTREF(__pyx_t_1);
13816 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13825 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 613, __pyx_L1_error)
13826 __Pyx_GOTREF(__pyx_t_2);
13835 __pyx_t_3 = PyTuple_New(2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 612, __pyx_L1_error)
13836 __Pyx_GOTREF(__pyx_t_3);
13837 __Pyx_GIVEREF(__pyx_t_1);
13838 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
13839 __Pyx_GIVEREF(__pyx_t_2);
13840 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
13843 __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 612, __pyx_L1_error)
13844 __Pyx_GOTREF(__pyx_t_2);
13845 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13846 __pyx_r = __pyx_t_2;
13860 __Pyx_XDECREF(__pyx_t_1);
13861 __Pyx_XDECREF(__pyx_t_2);
13862 __Pyx_XDECREF(__pyx_t_3);
13863 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13866 __Pyx_XGIVEREF(__pyx_r);
13867 __Pyx_TraceReturn(__pyx_r, 0);
13868 __Pyx_RefNannyFinishContext();
13881 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self);
13882 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
13883 PyObject *__pyx_r = 0;
13884 __Pyx_RefNannyDeclarations
13885 __Pyx_RefNannySetupContext(
"__str__ (wrapper)", 0);
13886 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13889 __Pyx_RefNannyFinishContext();
13893 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13894 PyObject *__pyx_r = NULL;
13895 __Pyx_TraceDeclarations
13896 __Pyx_RefNannyDeclarations
13897 PyObject *__pyx_t_1 = NULL;
13898 PyObject *__pyx_t_2 = NULL;
13899 int __pyx_lineno = 0;
13900 const char *__pyx_filename = NULL;
13901 int __pyx_clineno = 0;
13902 __Pyx_RefNannySetupContext(
"__str__", 0);
13903 __Pyx_TraceCall(
"__str__", __pyx_f[1], 615, 0, __PYX_ERR(1, 615, __pyx_L1_error));
13912 __Pyx_XDECREF(__pyx_r);
13913 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error)
13914 __Pyx_GOTREF(__pyx_t_1);
13915 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 616, __pyx_L1_error)
13916 __Pyx_GOTREF(__pyx_t_2);
13917 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13918 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error)
13919 __Pyx_GOTREF(__pyx_t_1);
13920 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13921 __pyx_t_2 = PyTuple_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 616, __pyx_L1_error)
13922 __Pyx_GOTREF(__pyx_t_2);
13923 __Pyx_GIVEREF(__pyx_t_1);
13924 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
13926 __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error)
13927 __Pyx_GOTREF(__pyx_t_1);
13928 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13929 __pyx_r = __pyx_t_1;
13943 __Pyx_XDECREF(__pyx_t_1);
13944 __Pyx_XDECREF(__pyx_t_2);
13945 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13948 __Pyx_XGIVEREF(__pyx_r);
13949 __Pyx_TraceReturn(__pyx_r, 0);
13950 __Pyx_RefNannyFinishContext();
13963 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
13964 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_17is_c_contig = {
"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0};
13965 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
13966 PyObject *__pyx_r = 0;
13967 __Pyx_RefNannyDeclarations
13968 __Pyx_RefNannySetupContext(
"is_c_contig (wrapper)", 0);
13969 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13972 __Pyx_RefNannyFinishContext();
13976 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(
struct __pyx_memoryview_obj *__pyx_v_self) {
13977 __Pyx_memviewslice *__pyx_v_mslice;
13978 __Pyx_memviewslice __pyx_v_tmp;
13979 PyObject *__pyx_r = NULL;
13980 __Pyx_TraceDeclarations
13981 __Pyx_RefNannyDeclarations
13982 __Pyx_memviewslice *__pyx_t_1;
13983 PyObject *__pyx_t_2 = NULL;
13984 int __pyx_lineno = 0;
13985 const char *__pyx_filename = NULL;
13986 int __pyx_clineno = 0;
13987 __Pyx_RefNannySetupContext(
"is_c_contig", 0);
13988 __Pyx_TraceCall(
"is_c_contig", __pyx_f[1], 619, 0, __PYX_ERR(1, 619, __pyx_L1_error));
13997 __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 622, __pyx_L1_error)
13998 __pyx_v_mslice = __pyx_t_1;
14007 __Pyx_XDECREF(__pyx_r);
14008 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]),
'C', __pyx_v_self->view.ndim));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 623, __pyx_L1_error)
14009 __Pyx_GOTREF(__pyx_t_2);
14010 __pyx_r = __pyx_t_2;
14024 __Pyx_XDECREF(__pyx_t_2);
14025 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
14028 __Pyx_XGIVEREF(__pyx_r);
14029 __Pyx_TraceReturn(__pyx_r, 0);
14030 __Pyx_RefNannyFinishContext();
14043 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
14044 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_19is_f_contig = {
"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0};
14045 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14046 PyObject *__pyx_r = 0;
14047 __Pyx_RefNannyDeclarations
14048 __Pyx_RefNannySetupContext(
"is_f_contig (wrapper)", 0);
14049 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14052 __Pyx_RefNannyFinishContext();
14056 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(
struct __pyx_memoryview_obj *__pyx_v_self) {
14057 __Pyx_memviewslice *__pyx_v_mslice;
14058 __Pyx_memviewslice __pyx_v_tmp;
14059 PyObject *__pyx_r = NULL;
14060 __Pyx_TraceDeclarations
14061 __Pyx_RefNannyDeclarations
14062 __Pyx_memviewslice *__pyx_t_1;
14063 PyObject *__pyx_t_2 = NULL;
14064 int __pyx_lineno = 0;
14065 const char *__pyx_filename = NULL;
14066 int __pyx_clineno = 0;
14067 __Pyx_RefNannySetupContext(
"is_f_contig", 0);
14068 __Pyx_TraceCall(
"is_f_contig", __pyx_f[1], 625, 0, __PYX_ERR(1, 625, __pyx_L1_error));
14077 __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 628, __pyx_L1_error)
14078 __pyx_v_mslice = __pyx_t_1;
14087 __Pyx_XDECREF(__pyx_r);
14088 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]),
'F', __pyx_v_self->view.ndim));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 629, __pyx_L1_error)
14089 __Pyx_GOTREF(__pyx_t_2);
14090 __pyx_r = __pyx_t_2;
14104 __Pyx_XDECREF(__pyx_t_2);
14105 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
14108 __Pyx_XGIVEREF(__pyx_r);
14109 __Pyx_TraceReturn(__pyx_r, 0);
14110 __Pyx_RefNannyFinishContext();
14123 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
14124 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_21copy = {
"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0};
14125 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14126 PyObject *__pyx_r = 0;
14127 __Pyx_RefNannyDeclarations
14128 __Pyx_RefNannySetupContext(
"copy (wrapper)", 0);
14129 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14132 __Pyx_RefNannyFinishContext();
14136 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(
struct __pyx_memoryview_obj *__pyx_v_self) {
14137 __Pyx_memviewslice __pyx_v_mslice;
14139 PyObject *__pyx_r = NULL;
14140 __Pyx_TraceDeclarations
14141 __Pyx_RefNannyDeclarations
14142 __Pyx_memviewslice __pyx_t_1;
14143 PyObject *__pyx_t_2 = NULL;
14144 int __pyx_lineno = 0;
14145 const char *__pyx_filename = NULL;
14146 int __pyx_clineno = 0;
14147 __Pyx_RefNannySetupContext(
"copy", 0);
14148 __Pyx_TraceCall(
"copy", __pyx_f[1], 631, 0, __PYX_ERR(1, 631, __pyx_L1_error));
14157 __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
14166 __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
14175 __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((
char *)
"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object);
if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 636, __pyx_L1_error)
14176 __pyx_v_mslice = __pyx_t_1;
14185 __Pyx_XDECREF(__pyx_r);
14186 __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 641, __pyx_L1_error)
14187 __Pyx_GOTREF(__pyx_t_2);
14188 __pyx_r = __pyx_t_2;
14202 __Pyx_XDECREF(__pyx_t_2);
14203 __Pyx_AddTraceback(
"View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
14206 __Pyx_XGIVEREF(__pyx_r);
14207 __Pyx_TraceReturn(__pyx_r, 0);
14208 __Pyx_RefNannyFinishContext();
14221 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
14222 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_23copy_fortran = {
"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0};
14223 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14224 PyObject *__pyx_r = 0;
14225 __Pyx_RefNannyDeclarations
14226 __Pyx_RefNannySetupContext(
"copy_fortran (wrapper)", 0);
14227 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14230 __Pyx_RefNannyFinishContext();
14234 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(
struct __pyx_memoryview_obj *__pyx_v_self) {
14235 __Pyx_memviewslice __pyx_v_src;
14236 __Pyx_memviewslice __pyx_v_dst;
14238 PyObject *__pyx_r = NULL;
14239 __Pyx_TraceDeclarations
14240 __Pyx_RefNannyDeclarations
14241 __Pyx_memviewslice __pyx_t_1;
14242 PyObject *__pyx_t_2 = NULL;
14243 int __pyx_lineno = 0;
14244 const char *__pyx_filename = NULL;
14245 int __pyx_clineno = 0;
14246 __Pyx_RefNannySetupContext(
"copy_fortran", 0);
14247 __Pyx_TraceCall(
"copy_fortran", __pyx_f[1], 643, 0, __PYX_ERR(1, 643, __pyx_L1_error));
14256 __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
14265 __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
14274 __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((
char *)
"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object);
if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 648, __pyx_L1_error)
14275 __pyx_v_dst = __pyx_t_1;
14284 __Pyx_XDECREF(__pyx_r);
14285 __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 653, __pyx_L1_error)
14286 __Pyx_GOTREF(__pyx_t_2);
14287 __pyx_r = __pyx_t_2;
14301 __Pyx_XDECREF(__pyx_t_2);
14302 __Pyx_AddTraceback(
"View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
14305 __Pyx_XGIVEREF(__pyx_r);
14306 __Pyx_TraceReturn(__pyx_r, 0);
14307 __Pyx_RefNannyFinishContext();
14318 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
14319 static PyMethodDef __pyx_mdef___pyx_memoryview_1__reduce_cython__ = {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0};
14320 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14321 PyObject *__pyx_r = 0;
14322 __Pyx_RefNannyDeclarations
14323 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
14324 __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14327 __Pyx_RefNannyFinishContext();
14331 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self) {
14332 PyObject *__pyx_r = NULL;
14333 __Pyx_TraceDeclarations
14334 __Pyx_RefNannyDeclarations
14335 PyObject *__pyx_t_1 = NULL;
14336 int __pyx_lineno = 0;
14337 const char *__pyx_filename = NULL;
14338 int __pyx_clineno = 0;
14339 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
14340 __Pyx_TraceCall(
"__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
14348 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__29, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
14349 __Pyx_GOTREF(__pyx_t_1);
14350 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
14351 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14352 __PYX_ERR(1, 2, __pyx_L1_error)
14362 __Pyx_XDECREF(__pyx_t_1);
14363 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14365 __Pyx_XGIVEREF(__pyx_r);
14366 __Pyx_TraceReturn(__pyx_r, 0);
14367 __Pyx_RefNannyFinishContext();
14379 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
14380 static PyMethodDef __pyx_mdef___pyx_memoryview_3__setstate_cython__ = {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0};
14381 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
14382 PyObject *__pyx_r = 0;
14383 __Pyx_RefNannyDeclarations
14384 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
14385 __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
14388 __Pyx_RefNannyFinishContext();
14392 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
14393 PyObject *__pyx_r = NULL;
14394 __Pyx_TraceDeclarations
14395 __Pyx_RefNannyDeclarations
14396 PyObject *__pyx_t_1 = NULL;
14397 int __pyx_lineno = 0;
14398 const char *__pyx_filename = NULL;
14399 int __pyx_clineno = 0;
14400 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
14401 __Pyx_TraceCall(
"__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
14408 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__30, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
14409 __Pyx_GOTREF(__pyx_t_1);
14410 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
14411 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14412 __PYX_ERR(1, 4, __pyx_L1_error)
14423 __Pyx_XDECREF(__pyx_t_1);
14424 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14426 __Pyx_XGIVEREF(__pyx_r);
14427 __Pyx_TraceReturn(__pyx_r, 0);
14428 __Pyx_RefNannyFinishContext();
14440 static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o,
int __pyx_v_flags,
int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) {
14441 struct __pyx_memoryview_obj *__pyx_v_result = 0;
14442 PyObject *__pyx_r = NULL;
14443 __Pyx_TraceDeclarations
14444 __Pyx_RefNannyDeclarations
14445 PyObject *__pyx_t_1 = NULL;
14446 PyObject *__pyx_t_2 = NULL;
14447 PyObject *__pyx_t_3 = NULL;
14448 int __pyx_lineno = 0;
14449 const char *__pyx_filename = NULL;
14450 int __pyx_clineno = 0;
14451 __Pyx_RefNannySetupContext(
"memoryview_cwrapper", 0);
14452 __Pyx_TraceCall(
"memoryview_cwrapper", __pyx_f[1], 657, 0, __PYX_ERR(1, 657, __pyx_L1_error));
14461 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 658, __pyx_L1_error)
14462 __Pyx_GOTREF(__pyx_t_1);
14463 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 658, __pyx_L1_error)
14464 __Pyx_GOTREF(__pyx_t_2);
14465 __pyx_t_3 = PyTuple_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 658, __pyx_L1_error)
14466 __Pyx_GOTREF(__pyx_t_3);
14467 __Pyx_INCREF(__pyx_v_o);
14468 __Pyx_GIVEREF(__pyx_v_o);
14469 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
14470 __Pyx_GIVEREF(__pyx_t_1);
14471 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
14472 __Pyx_GIVEREF(__pyx_t_2);
14473 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
14476 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 658, __pyx_L1_error)
14477 __Pyx_GOTREF(__pyx_t_2);
14478 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14479 __pyx_v_result = ((
struct __pyx_memoryview_obj *)__pyx_t_2);
14489 __pyx_v_result->typeinfo = __pyx_v_typeinfo;
14498 __Pyx_XDECREF(__pyx_r);
14499 __Pyx_INCREF(((PyObject *)__pyx_v_result));
14500 __pyx_r = ((PyObject *)__pyx_v_result);
14513 __Pyx_XDECREF(__pyx_t_1);
14514 __Pyx_XDECREF(__pyx_t_2);
14515 __Pyx_XDECREF(__pyx_t_3);
14516 __Pyx_AddTraceback(
"View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
14519 __Pyx_XDECREF((PyObject *)__pyx_v_result);
14520 __Pyx_XGIVEREF(__pyx_r);
14521 __Pyx_TraceReturn(__pyx_r, 0);
14522 __Pyx_RefNannyFinishContext();
14534 static CYTHON_INLINE
int __pyx_memoryview_check(PyObject *__pyx_v_o) {
14536 __Pyx_TraceDeclarations
14537 __Pyx_RefNannyDeclarations
14539 int __pyx_lineno = 0;
14540 const char *__pyx_filename = NULL;
14541 int __pyx_clineno = 0;
14542 __Pyx_RefNannySetupContext(
"memoryview_check", 0);
14543 __Pyx_TraceCall(
"memoryview_check", __pyx_f[1], 663, 0, __PYX_ERR(1, 663, __pyx_L1_error));
14552 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
14553 __pyx_r = __pyx_t_1;
14566 __Pyx_WriteUnraisable(
"View.MemoryView.memoryview_check", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
14569 __Pyx_TraceReturn(Py_None, 0);
14570 __Pyx_RefNannyFinishContext();
14582 static PyObject *_unellipsify(PyObject *__pyx_v_index,
int __pyx_v_ndim) {
14583 PyObject *__pyx_v_tup = NULL;
14584 PyObject *__pyx_v_result = NULL;
14585 int __pyx_v_have_slices;
14586 int __pyx_v_seen_ellipsis;
14587 CYTHON_UNUSED PyObject *__pyx_v_idx = NULL;
14588 PyObject *__pyx_v_item = NULL;
14589 Py_ssize_t __pyx_v_nslices;
14590 PyObject *__pyx_r = NULL;
14591 __Pyx_TraceDeclarations
14592 __Pyx_RefNannyDeclarations
14595 PyObject *__pyx_t_3 = NULL;
14596 PyObject *__pyx_t_4 = NULL;
14597 Py_ssize_t __pyx_t_5;
14598 PyObject *(*__pyx_t_6)(PyObject *);
14599 PyObject *__pyx_t_7 = NULL;
14600 Py_ssize_t __pyx_t_8;
14603 PyObject *__pyx_t_11 = NULL;
14604 int __pyx_lineno = 0;
14605 const char *__pyx_filename = NULL;
14606 int __pyx_clineno = 0;
14607 __Pyx_RefNannySetupContext(
"_unellipsify", 0);
14608 __Pyx_TraceCall(
"_unellipsify", __pyx_f[1], 666, 0, __PYX_ERR(1, 666, __pyx_L1_error));
14617 __pyx_t_1 = PyTuple_Check(__pyx_v_index);
14618 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
14628 __pyx_t_3 = PyTuple_New(1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 672, __pyx_L1_error)
14629 __Pyx_GOTREF(__pyx_t_3);
14630 __Pyx_INCREF(__pyx_v_index);
14631 __Pyx_GIVEREF(__pyx_v_index);
14632 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
14633 __pyx_v_tup = __pyx_t_3;
14654 __Pyx_INCREF(__pyx_v_index);
14655 __pyx_v_tup = __pyx_v_index;
14666 __pyx_t_3 = PyList_New(0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 676, __pyx_L1_error)
14667 __Pyx_GOTREF(__pyx_t_3);
14668 __pyx_v_result = ((PyObject*)__pyx_t_3);
14678 __pyx_v_have_slices = 0;
14687 __pyx_v_seen_ellipsis = 0;
14696 __Pyx_INCREF(__pyx_int_0);
14697 __pyx_t_3 = __pyx_int_0;
14698 if (likely(PyList_CheckExact(__pyx_v_tup)) || PyTuple_CheckExact(__pyx_v_tup)) {
14699 __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
14702 __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 679, __pyx_L1_error)
14703 __Pyx_GOTREF(__pyx_t_4);
14704 __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext;
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 679, __pyx_L1_error)
14707 if (likely(!__pyx_t_6)) {
14708 if (likely(PyList_CheckExact(__pyx_t_4))) {
14709 if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4))
break;
14710 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14711 __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++;
if (unlikely(0 < 0)) __PYX_ERR(1, 679, __pyx_L1_error)
14713 __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++;
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 679, __pyx_L1_error)
14714 __Pyx_GOTREF(__pyx_t_7);
14717 if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4))
break;
14718 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14719 __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++;
if (unlikely(0 < 0)) __PYX_ERR(1, 679, __pyx_L1_error)
14721 __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++;
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 679, __pyx_L1_error)
14722 __Pyx_GOTREF(__pyx_t_7);
14726 __pyx_t_7 = __pyx_t_6(__pyx_t_4);
14727 if (unlikely(!__pyx_t_7)) {
14728 PyObject* exc_type = PyErr_Occurred();
14730 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
14731 else __PYX_ERR(1, 679, __pyx_L1_error)
14735 __Pyx_GOTREF(__pyx_t_7);
14737 __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7);
14739 __Pyx_INCREF(__pyx_t_3);
14740 __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3);
14741 __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 679, __pyx_L1_error)
14742 __Pyx_GOTREF(__pyx_t_7);
14743 __Pyx_DECREF(__pyx_t_3);
14744 __pyx_t_3 = __pyx_t_7;
14754 __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
14755 __pyx_t_1 = (__pyx_t_2 != 0);
14765 __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
14775 __pyx_t_8 = PyObject_Length(__pyx_v_tup);
if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(1, 682, __pyx_L1_error)
14776 __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1)));
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 682, __pyx_L1_error)
14777 __Pyx_GOTREF(__pyx_t_7);
14778 { Py_ssize_t __pyx_temp;
14779 for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) {
14780 __Pyx_INCREF(__pyx_slice__7);
14781 __Pyx_GIVEREF(__pyx_slice__7);
14782 PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__7);
14785 __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 682, __pyx_L1_error)
14786 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14795 __pyx_v_seen_ellipsis = 1;
14815 __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__7);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 685, __pyx_L1_error)
14826 __pyx_v_have_slices = 1;
14846 __pyx_t_2 = PySlice_Check(__pyx_v_item);
14847 __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0);
14850 __pyx_t_1 = __pyx_t_10;
14851 goto __pyx_L9_bool_binop_done;
14853 __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0);
14854 __pyx_t_1 = __pyx_t_10;
14855 __pyx_L9_bool_binop_done:;
14856 if (unlikely(__pyx_t_1)) {
14865 __pyx_t_7 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item)));
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 689, __pyx_L1_error)
14866 __Pyx_GOTREF(__pyx_t_7);
14867 __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7);
if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 689, __pyx_L1_error)
14868 __Pyx_GOTREF(__pyx_t_11);
14869 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14870 __Pyx_Raise(__pyx_t_11, 0, 0, 0);
14871 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
14872 __PYX_ERR(1, 689, __pyx_L1_error)
14890 __pyx_t_10 = (__pyx_v_have_slices != 0);
14893 __pyx_t_1 = __pyx_t_10;
14894 goto __pyx_L11_bool_binop_done;
14896 __pyx_t_10 = PySlice_Check(__pyx_v_item);
14897 __pyx_t_2 = (__pyx_t_10 != 0);
14898 __pyx_t_1 = __pyx_t_2;
14899 __pyx_L11_bool_binop_done:;
14900 __pyx_v_have_slices = __pyx_t_1;
14909 __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 692, __pyx_L1_error)
14921 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14922 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14931 __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result);
if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 694, __pyx_L1_error)
14932 __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5);
14941 __pyx_t_1 = (__pyx_v_nslices != 0);
14951 __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices));
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 696, __pyx_L1_error)
14952 __Pyx_GOTREF(__pyx_t_3);
14953 { Py_ssize_t __pyx_temp;
14954 for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) {
14955 __Pyx_INCREF(__pyx_slice__7);
14956 __Pyx_GIVEREF(__pyx_slice__7);
14957 PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__7);
14960 __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 696, __pyx_L1_error)
14961 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14979 __Pyx_XDECREF(__pyx_r);
14980 if (!__pyx_v_have_slices) {
14982 __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error)
14983 __Pyx_GOTREF(__pyx_t_4);
14984 __pyx_t_3 = __pyx_t_4;
14986 goto __pyx_L14_bool_binop_done;
14988 __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error)
14989 __Pyx_GOTREF(__pyx_t_4);
14990 __pyx_t_3 = __pyx_t_4;
14992 __pyx_L14_bool_binop_done:;
14993 __pyx_t_4 = PyList_AsTuple(__pyx_v_result);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error)
14994 __Pyx_GOTREF(__pyx_t_4);
14995 __pyx_t_11 = PyTuple_New(2);
if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 698, __pyx_L1_error)
14996 __Pyx_GOTREF(__pyx_t_11);
14997 __Pyx_GIVEREF(__pyx_t_3);
14998 PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3);
14999 __Pyx_GIVEREF(__pyx_t_4);
15000 PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4);
15003 __pyx_r = ((PyObject*)__pyx_t_11);
15017 __Pyx_XDECREF(__pyx_t_3);
15018 __Pyx_XDECREF(__pyx_t_4);
15019 __Pyx_XDECREF(__pyx_t_7);
15020 __Pyx_XDECREF(__pyx_t_11);
15021 __Pyx_AddTraceback(
"View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
15024 __Pyx_XDECREF(__pyx_v_tup);
15025 __Pyx_XDECREF(__pyx_v_result);
15026 __Pyx_XDECREF(__pyx_v_idx);
15027 __Pyx_XDECREF(__pyx_v_item);
15028 __Pyx_XGIVEREF(__pyx_r);
15029 __Pyx_TraceReturn(__pyx_r, 0);
15030 __Pyx_RefNannyFinishContext();
15042 static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets,
int __pyx_v_ndim) {
15043 Py_ssize_t __pyx_v_suboffset;
15044 PyObject *__pyx_r = NULL;
15045 __Pyx_TraceDeclarations
15046 __Pyx_RefNannyDeclarations
15047 Py_ssize_t *__pyx_t_1;
15048 Py_ssize_t *__pyx_t_2;
15049 Py_ssize_t *__pyx_t_3;
15051 PyObject *__pyx_t_5 = NULL;
15052 int __pyx_lineno = 0;
15053 const char *__pyx_filename = NULL;
15054 int __pyx_clineno = 0;
15055 __Pyx_RefNannySetupContext(
"assert_direct_dimensions", 0);
15056 __Pyx_TraceCall(
"assert_direct_dimensions", __pyx_f[1], 700, 0, __PYX_ERR(1, 700, __pyx_L1_error));
15065 __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
15066 for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
15067 __pyx_t_1 = __pyx_t_3;
15068 __pyx_v_suboffset = (__pyx_t_1[0]);
15077 __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0);
15078 if (unlikely(__pyx_t_4)) {
15087 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__31, NULL);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 703, __pyx_L1_error)
15088 __Pyx_GOTREF(__pyx_t_5);
15089 __Pyx_Raise(__pyx_t_5, 0, 0, 0);
15090 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15091 __PYX_ERR(1, 703, __pyx_L1_error)
15112 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15115 __Pyx_XDECREF(__pyx_t_5);
15116 __Pyx_AddTraceback(
"View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
15119 __Pyx_XGIVEREF(__pyx_r);
15120 __Pyx_TraceReturn(__pyx_r, 0);
15121 __Pyx_RefNannyFinishContext();
15133 static struct __pyx_memoryview_obj *__pyx_memview_slice(
struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
15134 int __pyx_v_new_ndim;
15135 int __pyx_v_suboffset_dim;
15137 __Pyx_memviewslice __pyx_v_src;
15138 __Pyx_memviewslice __pyx_v_dst;
15139 __Pyx_memviewslice *__pyx_v_p_src;
15140 struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
15141 __Pyx_memviewslice *__pyx_v_p_dst;
15142 int *__pyx_v_p_suboffset_dim;
15143 Py_ssize_t __pyx_v_start;
15144 Py_ssize_t __pyx_v_stop;
15145 Py_ssize_t __pyx_v_step;
15146 int __pyx_v_have_start;
15147 int __pyx_v_have_stop;
15148 int __pyx_v_have_step;
15149 PyObject *__pyx_v_index = NULL;
15150 struct __pyx_memoryview_obj *__pyx_r = NULL;
15151 __Pyx_TraceDeclarations
15152 __Pyx_RefNannyDeclarations
15155 PyObject *__pyx_t_3 = NULL;
15156 struct __pyx_memoryview_obj *__pyx_t_4;
15159 Py_ssize_t __pyx_t_7;
15160 PyObject *(*__pyx_t_8)(PyObject *);
15161 PyObject *__pyx_t_9 = NULL;
15162 Py_ssize_t __pyx_t_10;
15164 Py_ssize_t __pyx_t_12;
15165 int __pyx_lineno = 0;
15166 const char *__pyx_filename = NULL;
15167 int __pyx_clineno = 0;
15168 __Pyx_RefNannySetupContext(
"memview_slice", 0);
15169 __Pyx_TraceCall(
"memview_slice", __pyx_f[1], 710, 0, __PYX_ERR(1, 710, __pyx_L1_error));
15178 __pyx_v_new_ndim = 0;
15179 __pyx_v_suboffset_dim = -1;
15188 (void)(memset((&__pyx_v_dst), 0, (
sizeof(__pyx_v_dst))));
15197 #ifndef CYTHON_WITHOUT_ASSERTIONS
15198 if (unlikely(!Py_OptimizeFlag)) {
15199 if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) {
15200 PyErr_SetNone(PyExc_AssertionError);
15201 __PYX_ERR(1, 722, __pyx_L1_error)
15213 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
15214 __pyx_t_2 = (__pyx_t_1 != 0);
15224 if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 725, __pyx_L1_error)
15225 __pyx_t_3 = ((PyObject *)__pyx_v_memview);
15226 __Pyx_INCREF(__pyx_t_3);
15227 __pyx_v_memviewsliceobj = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_3);
15237 __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
15257 __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
15266 __pyx_v_p_src = (&__pyx_v_src);
15277 __pyx_t_4 = __pyx_v_p_src->memview;
15278 __pyx_v_dst.memview = __pyx_t_4;
15287 __pyx_t_5 = __pyx_v_p_src->data;
15288 __pyx_v_dst.data = __pyx_t_5;
15297 __pyx_v_p_dst = (&__pyx_v_dst);
15306 __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
15316 if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
15317 __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
15320 __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 746, __pyx_L1_error)
15321 __Pyx_GOTREF(__pyx_t_3);
15322 __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext;
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 746, __pyx_L1_error)
15325 if (likely(!__pyx_t_8)) {
15326 if (likely(PyList_CheckExact(__pyx_t_3))) {
15327 if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3))
break;
15328 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15329 __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++;
if (unlikely(0 < 0)) __PYX_ERR(1, 746, __pyx_L1_error)
15331 __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++;
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 746, __pyx_L1_error)
15332 __Pyx_GOTREF(__pyx_t_9);
15335 if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3))
break;
15336 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15337 __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++;
if (unlikely(0 < 0)) __PYX_ERR(1, 746, __pyx_L1_error)
15339 __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++;
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 746, __pyx_L1_error)
15340 __Pyx_GOTREF(__pyx_t_9);
15344 __pyx_t_9 = __pyx_t_8(__pyx_t_3);
15345 if (unlikely(!__pyx_t_9)) {
15346 PyObject* exc_type = PyErr_Occurred();
15348 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
15349 else __PYX_ERR(1, 746, __pyx_L1_error)
15353 __Pyx_GOTREF(__pyx_t_9);
15355 __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9);
15357 __pyx_v_dim = __pyx_t_6;
15358 __pyx_t_6 = (__pyx_t_6 + 1);
15367 __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0);
15377 __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index);
if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 751, __pyx_L1_error)
15386 __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0);
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(1, 748, __pyx_L1_error)
15405 __pyx_t_2 = (__pyx_v_index == Py_None);
15406 __pyx_t_1 = (__pyx_t_2 != 0);
15416 (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
15425 (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
15434 (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1
L;
15443 __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
15463 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 760, __pyx_L1_error)
15464 __Pyx_GOTREF(__pyx_t_9);
15465 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 760, __pyx_L1_error)
15467 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15469 __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9);
if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 760, __pyx_L1_error)
15470 __pyx_t_10 = __pyx_t_12;
15471 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15472 goto __pyx_L7_bool_binop_done;
15475 __pyx_L7_bool_binop_done:;
15476 __pyx_v_start = __pyx_t_10;
15485 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 761, __pyx_L1_error)
15486 __Pyx_GOTREF(__pyx_t_9);
15487 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 761, __pyx_L1_error)
15489 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15491 __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9);
if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 761, __pyx_L1_error)
15492 __pyx_t_10 = __pyx_t_12;
15493 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15494 goto __pyx_L9_bool_binop_done;
15497 __pyx_L9_bool_binop_done:;
15498 __pyx_v_stop = __pyx_t_10;
15507 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 762, __pyx_L1_error)
15508 __Pyx_GOTREF(__pyx_t_9);
15509 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 762, __pyx_L1_error)
15511 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15513 __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9);
if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 762, __pyx_L1_error)
15514 __pyx_t_10 = __pyx_t_12;
15515 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15516 goto __pyx_L11_bool_binop_done;
15519 __pyx_L11_bool_binop_done:;
15520 __pyx_v_step = __pyx_t_10;
15529 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 764, __pyx_L1_error)
15530 __Pyx_GOTREF(__pyx_t_9);
15531 __pyx_t_1 = (__pyx_t_9 != Py_None);
15532 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15533 __pyx_v_have_start = __pyx_t_1;
15542 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 765, __pyx_L1_error)
15543 __Pyx_GOTREF(__pyx_t_9);
15544 __pyx_t_1 = (__pyx_t_9 != Py_None);
15545 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15546 __pyx_v_have_stop = __pyx_t_1;
15555 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 766, __pyx_L1_error)
15556 __Pyx_GOTREF(__pyx_t_9);
15557 __pyx_t_1 = (__pyx_t_9 != Py_None);
15558 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15559 __pyx_v_have_step = __pyx_t_1;
15568 __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1);
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(1, 768, __pyx_L1_error)
15577 __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
15589 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15598 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
15599 __pyx_t_2 = (__pyx_t_1 != 0);
15609 __Pyx_XDECREF(((PyObject *)__pyx_r));
15618 if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError(
"memviewsliceobj"); __PYX_ERR(1, 778, __pyx_L1_error) }
15627 if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError(
"memviewsliceobj"); __PYX_ERR(1, 779, __pyx_L1_error) }
15636 __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 777, __pyx_L1_error)
15637 __Pyx_GOTREF(__pyx_t_3);
15638 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 777, __pyx_L1_error)
15639 __pyx_r = ((
struct __pyx_memoryview_obj *)__pyx_t_3);
15660 __Pyx_XDECREF(((PyObject *)__pyx_r));
15669 __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 782, __pyx_L1_error)
15670 __Pyx_GOTREF(__pyx_t_3);
15679 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 782, __pyx_L1_error)
15680 __pyx_r = ((
struct __pyx_memoryview_obj *)__pyx_t_3);
15695 __Pyx_XDECREF(__pyx_t_3);
15696 __Pyx_XDECREF(__pyx_t_9);
15697 __Pyx_AddTraceback(
"View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
15700 __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
15701 __Pyx_XDECREF(__pyx_v_index);
15702 __Pyx_XGIVEREF((PyObject *)__pyx_r);
15703 __Pyx_TraceReturn(__pyx_r, 0);
15704 __Pyx_RefNannyFinishContext();
15716 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, Py_ssize_t __pyx_v_shape, Py_ssize_t __pyx_v_stride, Py_ssize_t __pyx_v_suboffset,
int __pyx_v_dim,
int __pyx_v_new_ndim,
int *__pyx_v_suboffset_dim, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop, Py_ssize_t __pyx_v_step,
int __pyx_v_have_start,
int __pyx_v_have_stop,
int __pyx_v_have_step,
int __pyx_v_is_slice) {
15717 Py_ssize_t __pyx_v_new_shape;
15718 int __pyx_v_negative_step;
15720 __Pyx_TraceDeclarations
15724 int __pyx_lineno = 0;
15725 const char *__pyx_filename = NULL;
15726 int __pyx_clineno = 0;
15727 __Pyx_TraceCall(
"slice_memviewslice", __pyx_f[1], 807, 1, __PYX_ERR(1, 807, __pyx_L1_error));
15736 __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
15746 __pyx_t_1 = ((__pyx_v_start < 0) != 0);
15756 __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
15774 __pyx_t_1 = (0 <= __pyx_v_start);
15776 __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
15778 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
15788 __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((
char *)
"Index out of bounds (axis %d)"), __pyx_v_dim);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(1, 832, __pyx_L1_error)
15817 __pyx_t_1 = ((__pyx_v_have_step != 0) != 0);
15820 __pyx_t_2 = __pyx_t_1;
15821 goto __pyx_L6_bool_binop_done;
15823 __pyx_t_1 = ((__pyx_v_step < 0) != 0);
15824 __pyx_t_2 = __pyx_t_1;
15825 __pyx_L6_bool_binop_done:;
15826 __pyx_v_negative_step = __pyx_t_2;
15835 __pyx_t_1 = (__pyx_v_have_step != 0);
15838 __pyx_t_2 = __pyx_t_1;
15839 goto __pyx_L9_bool_binop_done;
15841 __pyx_t_1 = ((__pyx_v_step == 0) != 0);
15842 __pyx_t_2 = __pyx_t_1;
15843 __pyx_L9_bool_binop_done:;
15853 __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((
char *)
"Step may not be zero (axis %d)"), __pyx_v_dim);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(1, 838, __pyx_L1_error)
15871 __pyx_t_2 = (__pyx_v_have_start != 0);
15881 __pyx_t_2 = ((__pyx_v_start < 0) != 0);
15891 __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
15900 __pyx_t_2 = ((__pyx_v_start < 0) != 0);
15938 __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
15948 __pyx_t_2 = (__pyx_v_negative_step != 0);
15958 __pyx_v_start = (__pyx_v_shape - 1);
15978 __pyx_v_start = __pyx_v_shape;
16010 __pyx_t_2 = (__pyx_v_negative_step != 0);
16020 __pyx_v_start = (__pyx_v_shape - 1);
16053 __pyx_t_2 = (__pyx_v_have_stop != 0);
16063 __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
16073 __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
16082 __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
16120 __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
16130 __pyx_v_stop = __pyx_v_shape;
16160 __pyx_t_2 = (__pyx_v_negative_step != 0);
16170 __pyx_v_stop = -1
L;
16190 __pyx_v_stop = __pyx_v_shape;
16203 __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
16231 __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
16240 __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
16250 __pyx_v_new_shape = (__pyx_v_new_shape + 1);
16268 __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
16278 __pyx_v_new_shape = 0;
16296 (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
16305 (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
16314 (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
16325 __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
16335 __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
16355 __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
16356 (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
16367 __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
16377 __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
16387 __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
16397 __pyx_v_dst->data = ((((
char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
16425 __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((
char *)
"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(1, 899, __pyx_L1_error)
16447 (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
16482 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
16484 __Pyx_AddTraceback(
"View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
16486 __Pyx_PyGILState_Release(__pyx_gilstate_save);
16491 __Pyx_TraceReturn(Py_None, 1);
16503 static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view,
char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) {
16504 Py_ssize_t __pyx_v_shape;
16505 Py_ssize_t __pyx_v_stride;
16506 Py_ssize_t __pyx_v_suboffset;
16507 Py_ssize_t __pyx_v_itemsize;
16508 char *__pyx_v_resultp;
16510 __Pyx_TraceDeclarations
16511 __Pyx_RefNannyDeclarations
16512 Py_ssize_t __pyx_t_1;
16514 PyObject *__pyx_t_3 = NULL;
16515 PyObject *__pyx_t_4 = NULL;
16516 int __pyx_lineno = 0;
16517 const char *__pyx_filename = NULL;
16518 int __pyx_clineno = 0;
16519 __Pyx_RefNannySetupContext(
"pybuffer_index", 0);
16520 __Pyx_TraceCall(
"pybuffer_index", __pyx_f[1], 910, 0, __PYX_ERR(1, 910, __pyx_L1_error));
16529 __pyx_v_suboffset = -1
L;
16538 __pyx_t_1 = __pyx_v_view->itemsize;
16539 __pyx_v_itemsize = __pyx_t_1;
16548 __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
16558 if (unlikely(__pyx_v_itemsize == 0)) {
16559 PyErr_SetString(PyExc_ZeroDivisionError,
"integer division or modulo by zero");
16560 __PYX_ERR(1, 917, __pyx_L1_error)
16562 else if (
sizeof(Py_ssize_t) ==
sizeof(
long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
16563 PyErr_SetString(PyExc_OverflowError,
"value too large to perform division");
16564 __PYX_ERR(1, 917, __pyx_L1_error)
16566 __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize);
16575 __pyx_v_stride = __pyx_v_itemsize;
16595 __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
16604 __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
16613 __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
16623 __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
16643 __pyx_t_2 = ((__pyx_v_index < 0) != 0);
16653 __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
16662 __pyx_t_2 = ((__pyx_v_index < 0) != 0);
16663 if (unlikely(__pyx_t_2)) {
16672 __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 928, __pyx_L1_error)
16673 __Pyx_GOTREF(__pyx_t_3);
16674 __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 928, __pyx_L1_error)
16675 __Pyx_GOTREF(__pyx_t_4);
16676 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16677 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 928, __pyx_L1_error)
16678 __Pyx_GOTREF(__pyx_t_3);
16679 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16680 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
16681 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16682 __PYX_ERR(1, 928, __pyx_L1_error)
16709 __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
16710 if (unlikely(__pyx_t_2)) {
16719 __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 931, __pyx_L1_error)
16720 __Pyx_GOTREF(__pyx_t_3);
16721 __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 931, __pyx_L1_error)
16722 __Pyx_GOTREF(__pyx_t_4);
16723 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16724 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 931, __pyx_L1_error)
16725 __Pyx_GOTREF(__pyx_t_3);
16726 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16727 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
16728 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16729 __PYX_ERR(1, 931, __pyx_L1_error)
16747 __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
16756 __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
16766 __pyx_v_resultp = ((((
char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
16784 __pyx_r = __pyx_v_resultp;
16797 __Pyx_XDECREF(__pyx_t_3);
16798 __Pyx_XDECREF(__pyx_t_4);
16799 __Pyx_AddTraceback(
"View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
16802 __Pyx_TraceReturn(Py_None, 0);
16803 __Pyx_RefNannyFinishContext();
16815 static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
16817 Py_ssize_t *__pyx_v_shape;
16818 Py_ssize_t *__pyx_v_strides;
16822 __Pyx_TraceDeclarations
16824 Py_ssize_t *__pyx_t_2;
16827 Py_ssize_t __pyx_t_5;
16828 Py_ssize_t __pyx_t_6;
16832 int __pyx_lineno = 0;
16833 const char *__pyx_filename = NULL;
16834 int __pyx_clineno = 0;
16835 __Pyx_TraceCall(
"transpose_memslice", __pyx_f[1], 943, 1, __PYX_ERR(1, 943, __pyx_L1_error));
16844 __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
16845 __pyx_v_ndim = __pyx_t_1;
16854 __pyx_t_2 = __pyx_v_memslice->shape;
16855 __pyx_v_shape = __pyx_t_2;
16864 __pyx_t_2 = __pyx_v_memslice->strides;
16865 __pyx_v_strides = __pyx_t_2;
16874 __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2);
16875 __pyx_t_4 = __pyx_t_3;
16876 for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
16877 __pyx_v_i = __pyx_t_1;
16886 __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
16895 __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
16896 __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
16897 (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
16898 (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
16907 __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
16908 __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
16909 (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
16910 (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
16919 __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0);
16922 __pyx_t_7 = __pyx_t_8;
16923 goto __pyx_L6_bool_binop_done;
16925 __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0);
16926 __pyx_t_7 = __pyx_t_8;
16927 __pyx_L6_bool_binop_done:;
16937 __pyx_t_9 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((
char *)
"Cannot transpose memoryview with indirect dimensions"));
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 957, __pyx_L1_error)
16971 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
16973 __Pyx_AddTraceback(
"View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
16975 __Pyx_PyGILState_Release(__pyx_gilstate_save);
16980 __Pyx_TraceReturn(Py_None, 1);
16993 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self);
16994 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
16995 __Pyx_RefNannyDeclarations
16996 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
16997 __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self));
17000 __Pyx_RefNannyFinishContext();
17003 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(
struct __pyx_memoryviewslice_obj *__pyx_v_self) {
17004 __Pyx_TraceDeclarations
17005 __Pyx_RefNannyDeclarations
17006 int __pyx_lineno = 0;
17007 const char *__pyx_filename = NULL;
17008 int __pyx_clineno = 0;
17009 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
17010 __Pyx_TraceCall(
"__dealloc__", __pyx_f[1], 976, 0, __PYX_ERR(1, 976, __pyx_L1_error));
17019 __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);
17032 __Pyx_WriteUnraisable(
"View.MemoryView._memoryviewslice.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
17034 __Pyx_TraceReturn(Py_None, 0);
17035 __Pyx_RefNannyFinishContext();
17046 static PyObject *__pyx_memoryviewslice_convert_item_to_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp) {
17047 PyObject *__pyx_r = NULL;
17048 __Pyx_TraceDeclarations
17049 __Pyx_RefNannyDeclarations
17051 PyObject *__pyx_t_2 = NULL;
17052 int __pyx_lineno = 0;
17053 const char *__pyx_filename = NULL;
17054 int __pyx_clineno = 0;
17055 __Pyx_RefNannySetupContext(
"convert_item_to_object", 0);
17056 __Pyx_TraceCall(
"convert_item_to_object", __pyx_f[1], 979, 0, __PYX_ERR(1, 979, __pyx_L1_error));
17065 __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
17075 __Pyx_XDECREF(__pyx_r);
17076 __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 981, __pyx_L1_error)
17077 __Pyx_GOTREF(__pyx_t_2);
17078 __pyx_r = __pyx_t_2;
17099 __Pyx_XDECREF(__pyx_r);
17100 __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((
struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 983, __pyx_L1_error)
17101 __Pyx_GOTREF(__pyx_t_2);
17102 __pyx_r = __pyx_t_2;
17117 __Pyx_XDECREF(__pyx_t_2);
17118 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
17121 __Pyx_XGIVEREF(__pyx_r);
17122 __Pyx_TraceReturn(__pyx_r, 0);
17123 __Pyx_RefNannyFinishContext();
17135 static PyObject *__pyx_memoryviewslice_assign_item_from_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value) {
17136 PyObject *__pyx_r = NULL;
17137 __Pyx_TraceDeclarations
17138 __Pyx_RefNannyDeclarations
17141 PyObject *__pyx_t_3 = NULL;
17142 int __pyx_lineno = 0;
17143 const char *__pyx_filename = NULL;
17144 int __pyx_clineno = 0;
17145 __Pyx_RefNannySetupContext(
"assign_item_from_object", 0);
17146 __Pyx_TraceCall(
"assign_item_from_object", __pyx_f[1], 985, 0, __PYX_ERR(1, 985, __pyx_L1_error));
17155 __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
17165 __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value);
if (unlikely(__pyx_t_2 == ((
int)0))) __PYX_ERR(1, 987, __pyx_L1_error)
17185 __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((
struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 989, __pyx_L1_error)
17186 __Pyx_GOTREF(__pyx_t_3);
17187 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17200 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17203 __Pyx_XDECREF(__pyx_t_3);
17204 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
17207 __Pyx_XGIVEREF(__pyx_r);
17208 __Pyx_TraceReturn(__pyx_r, 0);
17209 __Pyx_RefNannyFinishContext();
17222 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self);
17223 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self) {
17224 PyObject *__pyx_r = 0;
17225 __Pyx_RefNannyDeclarations
17226 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
17227 __pyx_r = __pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self));
17230 __Pyx_RefNannyFinishContext();
17234 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(
struct __pyx_memoryviewslice_obj *__pyx_v_self) {
17235 PyObject *__pyx_r = NULL;
17236 __Pyx_TraceDeclarations
17237 __Pyx_RefNannyDeclarations
17238 int __pyx_lineno = 0;
17239 const char *__pyx_filename = NULL;
17240 int __pyx_clineno = 0;
17241 __Pyx_RefNannySetupContext(
"__get__", 0);
17242 __Pyx_TraceCall(
"__get__", __pyx_f[1], 992, 0, __PYX_ERR(1, 992, __pyx_L1_error));
17251 __Pyx_XDECREF(__pyx_r);
17252 __Pyx_INCREF(__pyx_v_self->from_object);
17253 __pyx_r = __pyx_v_self->from_object;
17266 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.base.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17269 __Pyx_XGIVEREF(__pyx_r);
17270 __Pyx_TraceReturn(__pyx_r, 0);
17271 __Pyx_RefNannyFinishContext();
17282 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
17283 static PyMethodDef __pyx_mdef___pyx_memoryviewslice_1__reduce_cython__ = {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0};
17284 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
17285 PyObject *__pyx_r = 0;
17286 __Pyx_RefNannyDeclarations
17287 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
17288 __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self));
17291 __Pyx_RefNannyFinishContext();
17295 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self) {
17296 PyObject *__pyx_r = NULL;
17297 __Pyx_TraceDeclarations
17298 __Pyx_RefNannyDeclarations
17299 PyObject *__pyx_t_1 = NULL;
17300 int __pyx_lineno = 0;
17301 const char *__pyx_filename = NULL;
17302 int __pyx_clineno = 0;
17303 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
17304 __Pyx_TraceCall(
"__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
17312 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__32, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
17313 __Pyx_GOTREF(__pyx_t_1);
17314 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
17315 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17316 __PYX_ERR(1, 2, __pyx_L1_error)
17326 __Pyx_XDECREF(__pyx_t_1);
17327 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17329 __Pyx_XGIVEREF(__pyx_r);
17330 __Pyx_TraceReturn(__pyx_r, 0);
17331 __Pyx_RefNannyFinishContext();
17343 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
17344 static PyMethodDef __pyx_mdef___pyx_memoryviewslice_3__setstate_cython__ = {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0};
17345 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
17346 PyObject *__pyx_r = 0;
17347 __Pyx_RefNannyDeclarations
17348 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
17349 __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
17352 __Pyx_RefNannyFinishContext();
17356 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
17357 PyObject *__pyx_r = NULL;
17358 __Pyx_TraceDeclarations
17359 __Pyx_RefNannyDeclarations
17360 PyObject *__pyx_t_1 = NULL;
17361 int __pyx_lineno = 0;
17362 const char *__pyx_filename = NULL;
17363 int __pyx_clineno = 0;
17364 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
17365 __Pyx_TraceCall(
"__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
17372 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__33, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
17373 __Pyx_GOTREF(__pyx_t_1);
17374 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
17375 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17376 __PYX_ERR(1, 4, __pyx_L1_error)
17387 __Pyx_XDECREF(__pyx_t_1);
17388 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17390 __Pyx_XGIVEREF(__pyx_r);
17391 __Pyx_TraceReturn(__pyx_r, 0);
17392 __Pyx_RefNannyFinishContext();
17404 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice,
int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(
char *),
int (*__pyx_v_to_dtype_func)(
char *, PyObject *),
int __pyx_v_dtype_is_object) {
17405 struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
17406 Py_ssize_t __pyx_v_suboffset;
17407 PyObject *__pyx_v_length = NULL;
17408 PyObject *__pyx_r = NULL;
17409 __Pyx_TraceDeclarations
17410 __Pyx_RefNannyDeclarations
17412 PyObject *__pyx_t_2 = NULL;
17413 PyObject *__pyx_t_3 = NULL;
17414 __Pyx_TypeInfo *__pyx_t_4;
17415 Py_buffer __pyx_t_5;
17416 Py_ssize_t *__pyx_t_6;
17417 Py_ssize_t *__pyx_t_7;
17418 Py_ssize_t *__pyx_t_8;
17419 Py_ssize_t __pyx_t_9;
17420 int __pyx_lineno = 0;
17421 const char *__pyx_filename = NULL;
17422 int __pyx_clineno = 0;
17423 __Pyx_RefNannySetupContext(
"memoryview_fromslice", 0);
17424 __Pyx_TraceCall(
"memoryview_fromslice", __pyx_f[1], 999, 0, __PYX_ERR(1, 999, __pyx_L1_error));
17433 __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
17443 __Pyx_XDECREF(__pyx_r);
17444 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17463 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error)
17464 __Pyx_GOTREF(__pyx_t_2);
17465 __pyx_t_3 = PyTuple_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1013, __pyx_L1_error)
17466 __Pyx_GOTREF(__pyx_t_3);
17467 __Pyx_INCREF(Py_None);
17468 __Pyx_GIVEREF(Py_None);
17469 PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None);
17470 __Pyx_INCREF(__pyx_int_0);
17471 __Pyx_GIVEREF(__pyx_int_0);
17472 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
17473 __Pyx_GIVEREF(__pyx_t_2);
17474 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
17476 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error)
17477 __Pyx_GOTREF(__pyx_t_2);
17478 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17479 __pyx_v_result = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_2);
17489 __pyx_v_result->from_slice = __pyx_v_memviewslice;
17498 __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
17507 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1018, __pyx_L1_error)
17508 __Pyx_GOTREF(__pyx_t_2);
17509 __Pyx_GIVEREF(__pyx_t_2);
17510 __Pyx_GOTREF(__pyx_v_result->from_object);
17511 __Pyx_DECREF(__pyx_v_result->from_object);
17512 __pyx_v_result->from_object = __pyx_t_2;
17522 __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
17523 __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
17532 __pyx_t_5 = __pyx_v_memviewslice.memview->view;
17533 __pyx_v_result->__pyx_base.view = __pyx_t_5;
17542 __pyx_v_result->__pyx_base.view.buf = ((
void *)__pyx_v_memviewslice.data);
17551 __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
17560 ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
17569 Py_INCREF(Py_None);
17578 __pyx_t_1 = ((((
struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
17588 __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
17608 __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
17619 __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
17628 __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
17637 __pyx_v_result->__pyx_base.view.suboffsets = NULL;
17646 __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
17647 for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
17648 __pyx_t_6 = __pyx_t_8;
17649 __pyx_v_suboffset = (__pyx_t_6[0]);
17658 __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0);
17668 __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
17677 goto __pyx_L6_break;
17697 __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
17698 __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
17707 __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
17708 for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
17709 __pyx_t_6 = __pyx_t_8;
17710 __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0]));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1043, __pyx_L1_error)
17711 __Pyx_GOTREF(__pyx_t_2);
17712 __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
17722 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1044, __pyx_L1_error)
17723 __Pyx_GOTREF(__pyx_t_2);
17724 __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1044, __pyx_L1_error)
17725 __Pyx_GOTREF(__pyx_t_3);
17726 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17727 __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3);
if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1044, __pyx_L1_error)
17728 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17729 __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
17739 __pyx_v_result->to_object_func = __pyx_v_to_object_func;
17748 __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
17757 __Pyx_XDECREF(__pyx_r);
17758 __Pyx_INCREF(((PyObject *)__pyx_v_result));
17759 __pyx_r = ((PyObject *)__pyx_v_result);
17772 __Pyx_XDECREF(__pyx_t_2);
17773 __Pyx_XDECREF(__pyx_t_3);
17774 __Pyx_AddTraceback(
"View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
17777 __Pyx_XDECREF((PyObject *)__pyx_v_result);
17778 __Pyx_XDECREF(__pyx_v_length);
17779 __Pyx_XGIVEREF(__pyx_r);
17780 __Pyx_TraceReturn(__pyx_r, 0);
17781 __Pyx_RefNannyFinishContext();
17793 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(
struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
17794 struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
17795 __Pyx_memviewslice *__pyx_r;
17796 __Pyx_TraceDeclarations
17797 __Pyx_RefNannyDeclarations
17800 PyObject *__pyx_t_3 = NULL;
17801 int __pyx_lineno = 0;
17802 const char *__pyx_filename = NULL;
17803 int __pyx_clineno = 0;
17804 __Pyx_RefNannySetupContext(
"get_slice_from_memview", 0);
17805 __Pyx_TraceCall(
"get_slice_from_memview", __pyx_f[1], 1052, 0, __PYX_ERR(1, 1052, __pyx_L1_error));
17814 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
17815 __pyx_t_2 = (__pyx_t_1 != 0);
17825 if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 1056, __pyx_L1_error)
17826 __pyx_t_3 = ((PyObject *)__pyx_v_memview);
17827 __Pyx_INCREF(__pyx_t_3);
17828 __pyx_v_obj = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_3);
17838 __pyx_r = (&__pyx_v_obj->from_slice);
17858 __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
17867 __pyx_r = __pyx_v_mslice;
17881 __Pyx_XDECREF(__pyx_t_3);
17882 __Pyx_AddTraceback(
"View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
17885 __Pyx_XDECREF((PyObject *)__pyx_v_obj);
17886 __Pyx_TraceReturn(Py_None, 0);
17887 __Pyx_RefNannyFinishContext();
17899 static void __pyx_memoryview_slice_copy(
struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
17901 Py_ssize_t *__pyx_v_shape;
17902 Py_ssize_t *__pyx_v_strides;
17903 Py_ssize_t *__pyx_v_suboffsets;
17904 __Pyx_TraceDeclarations
17905 __Pyx_RefNannyDeclarations
17906 Py_ssize_t *__pyx_t_1;
17910 Py_ssize_t __pyx_t_5;
17911 int __pyx_lineno = 0;
17912 const char *__pyx_filename = NULL;
17913 int __pyx_clineno = 0;
17914 __Pyx_RefNannySetupContext(
"slice_copy", 0);
17915 __Pyx_TraceCall(
"slice_copy", __pyx_f[1], 1063, 0, __PYX_ERR(1, 1063, __pyx_L1_error));
17924 __pyx_t_1 = __pyx_v_memview->view.shape;
17925 __pyx_v_shape = __pyx_t_1;
17934 __pyx_t_1 = __pyx_v_memview->view.strides;
17935 __pyx_v_strides = __pyx_t_1;
17944 __pyx_t_1 = __pyx_v_memview->view.suboffsets;
17945 __pyx_v_suboffsets = __pyx_t_1;
17954 __pyx_v_dst->memview = ((
struct __pyx_memoryview_obj *)__pyx_v_memview);
17963 __pyx_v_dst->data = ((
char *)__pyx_v_memview->view.buf);
17972 __pyx_t_2 = __pyx_v_memview->view.ndim;
17973 __pyx_t_3 = __pyx_t_2;
17974 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
17975 __pyx_v_dim = __pyx_t_4;
17984 (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
17993 (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
18002 if ((__pyx_v_suboffsets != 0)) {
18003 __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
18007 (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
18021 __Pyx_WriteUnraisable(
"View.MemoryView.slice_copy", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
18023 __Pyx_TraceReturn(Py_None, 0);
18024 __Pyx_RefNannyFinishContext();
18035 static PyObject *__pyx_memoryview_copy_object(
struct __pyx_memoryview_obj *__pyx_v_memview) {
18036 __Pyx_memviewslice __pyx_v_memviewslice;
18037 PyObject *__pyx_r = NULL;
18038 __Pyx_TraceDeclarations
18039 __Pyx_RefNannyDeclarations
18040 PyObject *__pyx_t_1 = NULL;
18041 int __pyx_lineno = 0;
18042 const char *__pyx_filename = NULL;
18043 int __pyx_clineno = 0;
18044 __Pyx_RefNannySetupContext(
"memoryview_copy", 0);
18045 __Pyx_TraceCall(
"memoryview_copy", __pyx_f[1], 1080, 0, __PYX_ERR(1, 1080, __pyx_L1_error));
18054 __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
18063 __Pyx_XDECREF(__pyx_r);
18064 __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1084, __pyx_L1_error)
18065 __Pyx_GOTREF(__pyx_t_1);
18066 __pyx_r = __pyx_t_1;
18080 __Pyx_XDECREF(__pyx_t_1);
18081 __Pyx_AddTraceback(
"View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
18084 __Pyx_XGIVEREF(__pyx_r);
18085 __Pyx_TraceReturn(__pyx_r, 0);
18086 __Pyx_RefNannyFinishContext();
18098 static PyObject *__pyx_memoryview_copy_object_from_slice(
struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
18099 PyObject *(*__pyx_v_to_object_func)(
char *);
18100 int (*__pyx_v_to_dtype_func)(
char *, PyObject *);
18101 PyObject *__pyx_r = NULL;
18102 __Pyx_TraceDeclarations
18103 __Pyx_RefNannyDeclarations
18106 PyObject *(*__pyx_t_3)(
char *);
18107 int (*__pyx_t_4)(
char *, PyObject *);
18108 PyObject *__pyx_t_5 = NULL;
18109 int __pyx_lineno = 0;
18110 const char *__pyx_filename = NULL;
18111 int __pyx_clineno = 0;
18112 __Pyx_RefNannySetupContext(
"memoryview_copy_from_slice", 0);
18113 __Pyx_TraceCall(
"memoryview_copy_from_slice", __pyx_f[1], 1087, 0, __PYX_ERR(1, 1087, __pyx_L1_error));
18122 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
18123 __pyx_t_2 = (__pyx_t_1 != 0);
18133 __pyx_t_3 = ((
struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
18134 __pyx_v_to_object_func = __pyx_t_3;
18143 __pyx_t_4 = ((
struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
18144 __pyx_v_to_dtype_func = __pyx_t_4;
18164 __pyx_v_to_object_func = NULL;
18173 __pyx_v_to_dtype_func = NULL;
18184 __Pyx_XDECREF(__pyx_r);
18193 __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1101, __pyx_L1_error)
18194 __Pyx_GOTREF(__pyx_t_5);
18195 __pyx_r = __pyx_t_5;
18209 __Pyx_XDECREF(__pyx_t_5);
18210 __Pyx_AddTraceback(
"View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
18213 __Pyx_XGIVEREF(__pyx_r);
18214 __Pyx_TraceReturn(__pyx_r, 0);
18215 __Pyx_RefNannyFinishContext();
18227 static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
18228 Py_ssize_t __pyx_r;
18229 __Pyx_TraceDeclarations
18231 int __pyx_lineno = 0;
18232 const char *__pyx_filename = NULL;
18233 int __pyx_clineno = 0;
18234 __Pyx_TraceCall(
"abs_py_ssize_t", __pyx_f[1], 1109, 1, __PYX_ERR(1, 1109, __pyx_L1_error));
18243 __pyx_t_1 = ((__pyx_v_arg < 0) != 0);
18253 __pyx_r = (-__pyx_v_arg);
18273 __pyx_r = __pyx_v_arg;
18287 __Pyx_WriteUnraisable(
"View.MemoryView.abs_py_ssize_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
18290 __Pyx_TraceReturn(Py_None, 1);
18302 static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice,
int __pyx_v_ndim) {
18304 Py_ssize_t __pyx_v_c_stride;
18305 Py_ssize_t __pyx_v_f_stride;
18307 __Pyx_TraceDeclarations
18312 int __pyx_lineno = 0;
18313 const char *__pyx_filename = NULL;
18314 int __pyx_clineno = 0;
18315 __Pyx_TraceCall(
"get_best_order", __pyx_f[1], 1116, 1, __PYX_ERR(1, 1116, __pyx_L1_error));
18324 __pyx_v_c_stride = 0;
18333 __pyx_v_f_stride = 0;
18342 for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
18343 __pyx_v_i = __pyx_t_1;
18352 __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
18362 __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
18371 goto __pyx_L4_break;
18391 __pyx_t_1 = __pyx_v_ndim;
18392 __pyx_t_3 = __pyx_t_1;
18393 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18394 __pyx_v_i = __pyx_t_4;
18403 __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
18413 __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
18422 goto __pyx_L7_break;
18442 __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0);
18486 __Pyx_WriteUnraisable(
"View.MemoryView.get_best_order", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
18489 __Pyx_TraceReturn(Py_None, 1);
18501 static void _copy_strided_to_strided(
char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides,
char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape,
int __pyx_v_ndim,
size_t __pyx_v_itemsize) {
18502 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
18503 CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
18504 Py_ssize_t __pyx_v_dst_extent;
18505 Py_ssize_t __pyx_v_src_stride;
18506 Py_ssize_t __pyx_v_dst_stride;
18510 Py_ssize_t __pyx_t_4;
18511 Py_ssize_t __pyx_t_5;
18512 Py_ssize_t __pyx_t_6;
18521 __pyx_v_src_extent = (__pyx_v_src_shape[0]);
18530 __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
18539 __pyx_v_src_stride = (__pyx_v_src_strides[0]);
18548 __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
18557 __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
18567 __pyx_t_2 = ((__pyx_v_src_stride > 0) != 0);
18570 __pyx_t_1 = __pyx_t_2;
18571 goto __pyx_L5_bool_binop_done;
18573 __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0);
18576 __pyx_t_1 = __pyx_t_2;
18577 goto __pyx_L5_bool_binop_done;
18587 __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
18589 __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
18591 __pyx_t_3 = (__pyx_t_2 != 0);
18592 __pyx_t_1 = __pyx_t_3;
18593 __pyx_L5_bool_binop_done:;
18611 (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)));
18631 __pyx_t_4 = __pyx_v_dst_extent;
18632 __pyx_t_5 = __pyx_t_4;
18633 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
18634 __pyx_v_i = __pyx_t_6;
18643 (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));
18652 __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
18661 __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
18684 __pyx_t_4 = __pyx_v_dst_extent;
18685 __pyx_t_5 = __pyx_t_4;
18686 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
18687 __pyx_v_i = __pyx_t_6;
18696 _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize);
18705 __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
18714 __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
18738 static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst,
int __pyx_v_ndim,
size_t __pyx_v_itemsize) {
18739 __Pyx_TraceDeclarations
18740 int __pyx_lineno = 0;
18741 const char *__pyx_filename = NULL;
18742 int __pyx_clineno = 0;
18743 __Pyx_TraceCall(
"copy_strided_to_strided", __pyx_f[1], 1170, 1, __PYX_ERR(1, 1170, __pyx_L1_error));
18752 _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize);
18765 __Pyx_WriteUnraisable(
"View.MemoryView.copy_strided_to_strided", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
18767 __Pyx_TraceReturn(Py_None, 1);
18778 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src,
int __pyx_v_ndim) {
18779 Py_ssize_t __pyx_v_shape;
18780 Py_ssize_t __pyx_v_size;
18781 Py_ssize_t __pyx_r;
18782 __Pyx_TraceDeclarations
18783 Py_ssize_t __pyx_t_1;
18784 Py_ssize_t *__pyx_t_2;
18785 Py_ssize_t *__pyx_t_3;
18786 Py_ssize_t *__pyx_t_4;
18787 int __pyx_lineno = 0;
18788 const char *__pyx_filename = NULL;
18789 int __pyx_clineno = 0;
18790 __Pyx_TraceCall(
"slice_get_size", __pyx_f[1], 1177, 1, __PYX_ERR(1, 1177, __pyx_L1_error));
18799 __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
18800 __pyx_v_size = __pyx_t_1;
18809 __pyx_t_3 = (__pyx_v_src->shape + __pyx_v_ndim);
18810 for (__pyx_t_4 = __pyx_v_src->shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
18811 __pyx_t_2 = __pyx_t_4;
18812 __pyx_v_shape = (__pyx_t_2[0]);
18821 __pyx_v_size = (__pyx_v_size * __pyx_v_shape);
18831 __pyx_r = __pyx_v_size;
18844 __Pyx_WriteUnraisable(
"View.MemoryView.slice_get_size", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
18847 __Pyx_TraceReturn(Py_None, 1);
18859 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride,
int __pyx_v_ndim,
char __pyx_v_order) {
18861 Py_ssize_t __pyx_r;
18862 __Pyx_TraceDeclarations
18867 int __pyx_lineno = 0;
18868 const char *__pyx_filename = NULL;
18869 int __pyx_clineno = 0;
18870 __Pyx_TraceCall(
"fill_contig_strides_array", __pyx_f[1], 1187, 1, __PYX_ERR(1, 1187, __pyx_L1_error));
18879 __pyx_t_1 = ((__pyx_v_order ==
'F') != 0);
18889 __pyx_t_2 = __pyx_v_ndim;
18890 __pyx_t_3 = __pyx_t_2;
18891 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18892 __pyx_v_idx = __pyx_t_4;
18901 (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
18910 __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
18931 for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
18932 __pyx_v_idx = __pyx_t_2;
18941 (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
18950 __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
18962 __pyx_r = __pyx_v_stride;
18975 __Pyx_WriteUnraisable(
"View.MemoryView.fill_contig_strides_array", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
18978 __Pyx_TraceReturn(Py_None, 1);
18990 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_tmpslice,
char __pyx_v_order,
int __pyx_v_ndim) {
18992 void *__pyx_v_result;
18993 size_t __pyx_v_itemsize;
18994 size_t __pyx_v_size;
18996 __Pyx_TraceDeclarations
18997 Py_ssize_t __pyx_t_1;
19000 struct __pyx_memoryview_obj *__pyx_t_4;
19003 int __pyx_lineno = 0;
19004 const char *__pyx_filename = NULL;
19005 int __pyx_clineno = 0;
19006 __Pyx_TraceCall(
"copy_data_to_temp", __pyx_f[1], 1208, 1, __PYX_ERR(1, 1208, __pyx_L1_error));
19015 __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
19016 __pyx_v_itemsize = __pyx_t_1;
19025 __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
19034 __pyx_v_result = malloc(__pyx_v_size);
19043 __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
19053 __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(1, 1224, __pyx_L1_error)
19071 __pyx_v_tmpslice->data = ((
char *)__pyx_v_result);
19080 __pyx_t_4 = __pyx_v_src->memview;
19081 __pyx_v_tmpslice->memview = __pyx_t_4;
19090 __pyx_t_3 = __pyx_v_ndim;
19091 __pyx_t_5 = __pyx_t_3;
19092 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
19093 __pyx_v_i = __pyx_t_6;
19102 (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
19111 (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1
L;
19121 (void)(__pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order));
19130 __pyx_t_3 = __pyx_v_ndim;
19131 __pyx_t_5 = __pyx_t_3;
19132 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
19133 __pyx_v_i = __pyx_t_6;
19142 __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
19152 (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
19171 __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0);
19181 (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));
19201 copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
19212 __pyx_r = __pyx_v_result;
19227 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19229 __Pyx_AddTraceback(
"View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
19231 __Pyx_PyGILState_Release(__pyx_gilstate_save);
19236 __Pyx_TraceReturn(Py_None, 1);
19248 static int __pyx_memoryview_err_extents(
int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
19250 __Pyx_TraceDeclarations
19251 __Pyx_RefNannyDeclarations
19252 PyObject *__pyx_t_1 = NULL;
19253 PyObject *__pyx_t_2 = NULL;
19254 PyObject *__pyx_t_3 = NULL;
19255 PyObject *__pyx_t_4 = NULL;
19256 int __pyx_lineno = 0;
19257 const char *__pyx_filename = NULL;
19258 int __pyx_clineno = 0;
19260 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19262 __Pyx_RefNannySetupContext(
"_err_extents", 0);
19263 __Pyx_TraceCall(
"_err_extents", __pyx_f[1], 1251, 0, __PYX_ERR(1, 1251, __pyx_L1_error));
19272 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1254, __pyx_L1_error)
19273 __Pyx_GOTREF(__pyx_t_1);
19274 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1254, __pyx_L1_error)
19275 __Pyx_GOTREF(__pyx_t_2);
19276 __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1254, __pyx_L1_error)
19277 __Pyx_GOTREF(__pyx_t_3);
19278 __pyx_t_4 = PyTuple_New(3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1254, __pyx_L1_error)
19279 __Pyx_GOTREF(__pyx_t_4);
19280 __Pyx_GIVEREF(__pyx_t_1);
19281 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
19282 __Pyx_GIVEREF(__pyx_t_2);
19283 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
19284 __Pyx_GIVEREF(__pyx_t_3);
19285 PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
19297 __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1253, __pyx_L1_error)
19298 __Pyx_GOTREF(__pyx_t_3);
19299 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19300 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1253, __pyx_L1_error)
19301 __Pyx_GOTREF(__pyx_t_4);
19302 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19303 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
19304 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19305 __PYX_ERR(1, 1253, __pyx_L1_error)
19317 __Pyx_XDECREF(__pyx_t_1);
19318 __Pyx_XDECREF(__pyx_t_2);
19319 __Pyx_XDECREF(__pyx_t_3);
19320 __Pyx_XDECREF(__pyx_t_4);
19321 __Pyx_AddTraceback(
"View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
19323 __Pyx_TraceReturn(Py_None, 0);
19324 __Pyx_RefNannyFinishContext();
19326 __Pyx_PyGILState_Release(__pyx_gilstate_save);
19339 static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error,
char *__pyx_v_msg,
int __pyx_v_dim) {
19341 __Pyx_TraceDeclarations
19342 __Pyx_RefNannyDeclarations
19343 PyObject *__pyx_t_1 = NULL;
19344 PyObject *__pyx_t_2 = NULL;
19345 PyObject *__pyx_t_3 = NULL;
19346 PyObject *__pyx_t_4 = NULL;
19347 int __pyx_lineno = 0;
19348 const char *__pyx_filename = NULL;
19349 int __pyx_clineno = 0;
19351 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19353 __Pyx_RefNannySetupContext(
"_err_dim", 0);
19354 __Pyx_TraceCall(
"_err_dim", __pyx_f[1], 1257, 0, __PYX_ERR(1, 1257, __pyx_L1_error));
19355 __Pyx_INCREF(__pyx_v_error);
19364 __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1258, __pyx_L1_error)
19365 __Pyx_GOTREF(__pyx_t_2);
19366 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1258, __pyx_L1_error)
19367 __Pyx_GOTREF(__pyx_t_3);
19368 __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1258, __pyx_L1_error)
19369 __Pyx_GOTREF(__pyx_t_4);
19370 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19371 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19372 __Pyx_INCREF(__pyx_v_error);
19373 __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL;
19374 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
19375 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
19376 if (likely(__pyx_t_2)) {
19377 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
19378 __Pyx_INCREF(__pyx_t_2);
19379 __Pyx_INCREF(
function);
19380 __Pyx_DECREF_SET(__pyx_t_3,
function);
19383 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
19384 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
19385 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19386 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1258, __pyx_L1_error)
19387 __Pyx_GOTREF(__pyx_t_1);
19388 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19389 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
19390 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19391 __PYX_ERR(1, 1258, __pyx_L1_error)
19403 __Pyx_XDECREF(__pyx_t_1);
19404 __Pyx_XDECREF(__pyx_t_2);
19405 __Pyx_XDECREF(__pyx_t_3);
19406 __Pyx_XDECREF(__pyx_t_4);
19407 __Pyx_AddTraceback(
"View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename);
19409 __Pyx_XDECREF(__pyx_v_error);
19410 __Pyx_TraceReturn(Py_None, 0);
19411 __Pyx_RefNannyFinishContext();
19413 __Pyx_PyGILState_Release(__pyx_gilstate_save);
19426 static int __pyx_memoryview_err(PyObject *__pyx_v_error,
char *__pyx_v_msg) {
19428 __Pyx_TraceDeclarations
19429 __Pyx_RefNannyDeclarations
19431 PyObject *__pyx_t_2 = NULL;
19432 PyObject *__pyx_t_3 = NULL;
19433 PyObject *__pyx_t_4 = NULL;
19434 PyObject *__pyx_t_5 = NULL;
19435 int __pyx_lineno = 0;
19436 const char *__pyx_filename = NULL;
19437 int __pyx_clineno = 0;
19439 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19441 __Pyx_RefNannySetupContext(
"_err", 0);
19442 __Pyx_TraceCall(
"_err", __pyx_f[1], 1261, 0, __PYX_ERR(1, 1261, __pyx_L1_error));
19443 __Pyx_INCREF(__pyx_v_error);
19452 __pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
19453 if (unlikely(__pyx_t_1)) {
19462 __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1263, __pyx_L1_error)
19463 __Pyx_GOTREF(__pyx_t_3);
19464 __Pyx_INCREF(__pyx_v_error);
19465 __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL;
19466 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
19467 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
19468 if (likely(__pyx_t_5)) {
19469 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
19470 __Pyx_INCREF(__pyx_t_5);
19471 __Pyx_INCREF(
function);
19472 __Pyx_DECREF_SET(__pyx_t_4,
function);
19475 __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
19476 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
19477 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19478 if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1263, __pyx_L1_error)
19479 __Pyx_GOTREF(__pyx_t_2);
19480 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19481 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
19482 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19483 __PYX_ERR(1, 1263, __pyx_L1_error)
19502 __Pyx_Raise(__pyx_v_error, 0, 0, 0);
19503 __PYX_ERR(1, 1265, __pyx_L1_error)
19516 __Pyx_XDECREF(__pyx_t_2);
19517 __Pyx_XDECREF(__pyx_t_3);
19518 __Pyx_XDECREF(__pyx_t_4);
19519 __Pyx_XDECREF(__pyx_t_5);
19520 __Pyx_AddTraceback(
"View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename);
19522 __Pyx_XDECREF(__pyx_v_error);
19523 __Pyx_TraceReturn(Py_None, 0);
19524 __Pyx_RefNannyFinishContext();
19526 __Pyx_PyGILState_Release(__pyx_gilstate_save);
19539 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst,
int __pyx_v_src_ndim,
int __pyx_v_dst_ndim,
int __pyx_v_dtype_is_object) {
19540 void *__pyx_v_tmpdata;
19541 size_t __pyx_v_itemsize;
19543 char __pyx_v_order;
19544 int __pyx_v_broadcasting;
19545 int __pyx_v_direct_copy;
19546 __Pyx_memviewslice __pyx_v_tmp;
19549 __Pyx_TraceDeclarations
19550 Py_ssize_t __pyx_t_1;
19558 int __pyx_lineno = 0;
19559 const char *__pyx_filename = NULL;
19560 int __pyx_clineno = 0;
19561 __Pyx_TraceCall(
"memoryview_copy_contents", __pyx_f[1], 1268, 1, __PYX_ERR(1, 1268, __pyx_L1_error));
19570 __pyx_v_tmpdata = NULL;
19579 __pyx_t_1 = __pyx_v_src.memview->view.itemsize;
19580 __pyx_v_itemsize = __pyx_t_1;
19589 __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
19598 __pyx_v_broadcasting = 0;
19607 __pyx_v_direct_copy = 0;
19616 __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
19626 __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
19645 __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
19655 __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
19674 __pyx_t_3 = __pyx_v_dst_ndim;
19675 __pyx_t_4 = __pyx_v_src_ndim;
19676 if (((__pyx_t_3 > __pyx_t_4) != 0)) {
19677 __pyx_t_5 = __pyx_t_3;
19679 __pyx_t_5 = __pyx_t_4;
19681 __pyx_v_ndim = __pyx_t_5;
19690 __pyx_t_5 = __pyx_v_ndim;
19691 __pyx_t_3 = __pyx_t_5;
19692 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19693 __pyx_v_i = __pyx_t_4;
19702 __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0);
19712 __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
19722 __pyx_v_broadcasting = 1;
19731 (__pyx_v_src.strides[__pyx_v_i]) = 0;
19751 __pyx_t_6 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i]));
if (unlikely(__pyx_t_6 == ((
int)-1))) __PYX_ERR(1, 1297, __pyx_L1_error)
19771 __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
19781 __pyx_t_6 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((
char *)
"Dimension %d is not direct"), __pyx_v_i);
if (unlikely(__pyx_t_6 == ((
int)-1))) __PYX_ERR(1, 1300, __pyx_L1_error)
19800 __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0);
19810 __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0);
19820 __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
19838 __pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim);
if (unlikely(__pyx_t_7 == ((
void *)NULL))) __PYX_ERR(1, 1307, __pyx_L1_error)
19839 __pyx_v_tmpdata = __pyx_t_7;
19848 __pyx_v_src = __pyx_v_tmp;
19866 __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
19876 __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src,
'C', __pyx_v_ndim) != 0);
19886 __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst,
'C', __pyx_v_ndim);
19905 __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src,
'F', __pyx_v_ndim) != 0);
19915 __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst,
'F', __pyx_v_ndim);
19934 __pyx_t_2 = (__pyx_v_direct_copy != 0);
19944 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
19953 (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));
19962 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
19971 free(__pyx_v_tmpdata);
20008 __pyx_t_2 = (__pyx_v_order ==
'F');
20010 __pyx_t_2 = (
'F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
20012 __pyx_t_8 = (__pyx_t_2 != 0);
20022 __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src));
if (unlikely(__pyx_t_5 == ((
int)0))) __PYX_ERR(1, 1329, __pyx_L1_error)
20031 __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst));
if (unlikely(__pyx_t_5 == ((
int)0))) __PYX_ERR(1, 1330, __pyx_L1_error)
20049 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
20058 copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
20067 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
20076 free(__pyx_v_tmpdata);
20100 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20102 __Pyx_AddTraceback(
"View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
20104 __Pyx_PyGILState_Release(__pyx_gilstate_save);
20109 __Pyx_TraceReturn(Py_None, 1);
20121 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice,
int __pyx_v_ndim,
int __pyx_v_ndim_other) {
20123 int __pyx_v_offset;
20124 __Pyx_TraceDeclarations
20128 int __pyx_lineno = 0;
20129 const char *__pyx_filename = NULL;
20130 int __pyx_clineno = 0;
20131 __Pyx_TraceCall(
"broadcast_leading", __pyx_f[1], 1340, 1, __PYX_ERR(1, 1340, __pyx_L1_error));
20140 __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
20149 for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
20150 __pyx_v_i = __pyx_t_1;
20159 (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
20168 (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);
20177 (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
20187 __pyx_t_1 = __pyx_v_offset;
20188 __pyx_t_2 = __pyx_t_1;
20189 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
20190 __pyx_v_i = __pyx_t_3;
20199 (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
20208 (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
20217 (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1
L;
20231 __Pyx_WriteUnraisable(
"View.MemoryView.broadcast_leading", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
20233 __Pyx_TraceReturn(Py_None, 1);
20244 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst,
int __pyx_v_dtype_is_object,
int __pyx_v_ndim,
int __pyx_v_inc) {
20245 __Pyx_TraceDeclarations
20247 int __pyx_lineno = 0;
20248 const char *__pyx_filename = NULL;
20249 int __pyx_clineno = 0;
20250 __Pyx_TraceCall(
"refcount_copying", __pyx_f[1], 1362, 1, __PYX_ERR(1, 1362, __pyx_L1_error));
20259 __pyx_t_1 = (__pyx_v_dtype_is_object != 0);
20269 __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc);
20291 __Pyx_WriteUnraisable(
"View.MemoryView.refcount_copying", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
20293 __Pyx_TraceReturn(Py_None, 1);
20304 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(
char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides,
int __pyx_v_ndim,
int __pyx_v_inc) {
20305 __Pyx_TraceDeclarations
20306 __Pyx_RefNannyDeclarations
20307 int __pyx_lineno = 0;
20308 const char *__pyx_filename = NULL;
20309 int __pyx_clineno = 0;
20311 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20313 __Pyx_RefNannySetupContext(
"refcount_objects_in_slice_with_gil", 0);
20314 __Pyx_TraceCall(
"refcount_objects_in_slice_with_gil", __pyx_f[1], 1371, 0, __PYX_ERR(1, 1371, __pyx_L1_error));
20323 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
20336 __Pyx_WriteUnraisable(
"View.MemoryView.refcount_objects_in_slice_with_gil", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
20338 __Pyx_TraceReturn(Py_None, 0);
20339 __Pyx_RefNannyFinishContext();
20341 __Pyx_PyGILState_Release(__pyx_gilstate_save);
20353 static void __pyx_memoryview_refcount_objects_in_slice(
char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides,
int __pyx_v_ndim,
int __pyx_v_inc) {
20354 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
20355 __Pyx_TraceDeclarations
20356 __Pyx_RefNannyDeclarations
20357 Py_ssize_t __pyx_t_1;
20358 Py_ssize_t __pyx_t_2;
20359 Py_ssize_t __pyx_t_3;
20361 int __pyx_lineno = 0;
20362 const char *__pyx_filename = NULL;
20363 int __pyx_clineno = 0;
20364 __Pyx_RefNannySetupContext(
"refcount_objects_in_slice", 0);
20365 __Pyx_TraceCall(
"refcount_objects_in_slice", __pyx_f[1], 1377, 0, __PYX_ERR(1, 1377, __pyx_L1_error));
20374 __pyx_t_1 = (__pyx_v_shape[0]);
20375 __pyx_t_2 = __pyx_t_1;
20376 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
20377 __pyx_v_i = __pyx_t_3;
20386 __pyx_t_4 = ((__pyx_v_ndim == 1) != 0);
20396 __pyx_t_4 = (__pyx_v_inc != 0);
20406 Py_INCREF((((PyObject **)__pyx_v_data)[0]));
20426 Py_DECREF((((PyObject **)__pyx_v_data)[0]));
20456 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
20467 __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
20481 __Pyx_WriteUnraisable(
"View.MemoryView.refcount_objects_in_slice", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
20483 __Pyx_TraceReturn(Py_None, 0);
20484 __Pyx_RefNannyFinishContext();
20495 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst,
int __pyx_v_ndim,
size_t __pyx_v_itemsize,
void *__pyx_v_item,
int __pyx_v_dtype_is_object) {
20496 __Pyx_TraceDeclarations
20497 int __pyx_lineno = 0;
20498 const char *__pyx_filename = NULL;
20499 int __pyx_clineno = 0;
20500 __Pyx_TraceCall(
"slice_assign_scalar", __pyx_f[1], 1397, 1, __PYX_ERR(1, 1397, __pyx_L1_error));
20509 __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
20518 __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item);
20527 __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
20540 __Pyx_WriteUnraisable(
"View.MemoryView.slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
20542 __Pyx_TraceReturn(Py_None, 1);
20553 static void __pyx_memoryview__slice_assign_scalar(
char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides,
int __pyx_v_ndim,
size_t __pyx_v_itemsize,
void *__pyx_v_item) {
20554 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
20555 Py_ssize_t __pyx_v_stride;
20556 Py_ssize_t __pyx_v_extent;
20557 __Pyx_TraceDeclarations
20559 Py_ssize_t __pyx_t_2;
20560 Py_ssize_t __pyx_t_3;
20561 Py_ssize_t __pyx_t_4;
20562 int __pyx_lineno = 0;
20563 const char *__pyx_filename = NULL;
20564 int __pyx_clineno = 0;
20565 __Pyx_TraceCall(
"_slice_assign_scalar", __pyx_f[1], 1407, 1, __PYX_ERR(1, 1407, __pyx_L1_error));
20574 __pyx_v_stride = (__pyx_v_strides[0]);
20583 __pyx_v_extent = (__pyx_v_shape[0]);
20592 __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
20602 __pyx_t_2 = __pyx_v_extent;
20603 __pyx_t_3 = __pyx_t_2;
20604 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
20605 __pyx_v_i = __pyx_t_4;
20614 (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));
20623 __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
20644 __pyx_t_2 = __pyx_v_extent;
20645 __pyx_t_3 = __pyx_t_2;
20646 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
20647 __pyx_v_i = __pyx_t_4;
20656 __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item);
20665 __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
20681 __Pyx_WriteUnraisable(
"View.MemoryView._slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
20683 __Pyx_TraceReturn(Py_None, 1);
20693 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
20694 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum = {
"__pyx_unpickle_Enum", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum, METH_VARARGS|METH_KEYWORDS, 0};
20695 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
20696 PyObject *__pyx_v___pyx_type = 0;
20697 long __pyx_v___pyx_checksum;
20698 PyObject *__pyx_v___pyx_state = 0;
20699 int __pyx_lineno = 0;
20700 const char *__pyx_filename = NULL;
20701 int __pyx_clineno = 0;
20702 PyObject *__pyx_r = 0;
20703 __Pyx_RefNannyDeclarations
20704 __Pyx_RefNannySetupContext(
"__pyx_unpickle_Enum (wrapper)", 0);
20706 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
20707 PyObject* values[3] = {0,0,0};
20708 if (unlikely(__pyx_kwds)) {
20709 Py_ssize_t kw_args;
20710 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
20711 switch (pos_args) {
20712 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
20713 CYTHON_FALLTHROUGH;
20714 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
20715 CYTHON_FALLTHROUGH;
20716 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20717 CYTHON_FALLTHROUGH;
20719 default:
goto __pyx_L5_argtuple_error;
20721 kw_args = PyDict_Size(__pyx_kwds);
20722 switch (pos_args) {
20724 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
20725 else goto __pyx_L5_argtuple_error;
20726 CYTHON_FALLTHROUGH;
20728 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
20730 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
20732 CYTHON_FALLTHROUGH;
20734 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
20736 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
20739 if (unlikely(kw_args > 0)) {
20740 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__pyx_unpickle_Enum") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
20742 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
20743 goto __pyx_L5_argtuple_error;
20745 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20746 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
20747 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
20749 __pyx_v___pyx_type = values[0];
20750 __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]);
if (unlikely((__pyx_v___pyx_checksum == (
long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
20751 __pyx_v___pyx_state = values[2];
20753 goto __pyx_L4_argument_unpacking_done;
20754 __pyx_L5_argtuple_error:;
20755 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_Enum", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
20757 __Pyx_AddTraceback(
"View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
20758 __Pyx_RefNannyFinishContext();
20760 __pyx_L4_argument_unpacking_done:;
20761 __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
20764 __Pyx_RefNannyFinishContext();
20768 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type,
long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
20769 PyObject *__pyx_v___pyx_PickleError = 0;
20770 PyObject *__pyx_v___pyx_result = 0;
20771 PyObject *__pyx_r = NULL;
20772 __Pyx_TraceDeclarations
20773 __Pyx_RefNannyDeclarations
20775 PyObject *__pyx_t_2 = NULL;
20776 PyObject *__pyx_t_3 = NULL;
20777 PyObject *__pyx_t_4 = NULL;
20778 PyObject *__pyx_t_5 = NULL;
20780 int __pyx_lineno = 0;
20781 const char *__pyx_filename = NULL;
20782 int __pyx_clineno = 0;
20783 __Pyx_TraceFrameInit(__pyx_codeobj__34)
20784 __Pyx_RefNannySetupContext(
"__pyx_unpickle_Enum", 0);
20785 __Pyx_TraceCall(
"__pyx_unpickle_Enum", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
20794 __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xb068931) != 0);
20804 __pyx_t_2 = PyList_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
20805 __Pyx_GOTREF(__pyx_t_2);
20806 __Pyx_INCREF(__pyx_n_s_PickleError);
20807 __Pyx_GIVEREF(__pyx_n_s_PickleError);
20808 PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
20809 __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
20810 __Pyx_GOTREF(__pyx_t_3);
20811 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20812 __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
20813 __Pyx_GOTREF(__pyx_t_2);
20814 __Pyx_INCREF(__pyx_t_2);
20815 __pyx_v___pyx_PickleError = __pyx_t_2;
20816 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20817 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20826 __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error)
20827 __Pyx_GOTREF(__pyx_t_2);
20828 __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_t_2);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
20829 __Pyx_GOTREF(__pyx_t_4);
20830 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20831 __Pyx_INCREF(__pyx_v___pyx_PickleError);
20832 __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
20833 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
20834 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
20835 if (likely(__pyx_t_5)) {
20836 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
20837 __Pyx_INCREF(__pyx_t_5);
20838 __Pyx_INCREF(
function);
20839 __Pyx_DECREF_SET(__pyx_t_2,
function);
20842 __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
20843 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
20844 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20845 if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
20846 __Pyx_GOTREF(__pyx_t_3);
20847 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20848 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
20849 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20850 __PYX_ERR(1, 6, __pyx_L1_error)
20868 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
20869 __Pyx_GOTREF(__pyx_t_2);
20871 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
20872 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
20873 if (likely(__pyx_t_4)) {
20874 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
20875 __Pyx_INCREF(__pyx_t_4);
20876 __Pyx_INCREF(
function);
20877 __Pyx_DECREF_SET(__pyx_t_2,
function);
20880 __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
20881 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
20882 if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
20883 __Pyx_GOTREF(__pyx_t_3);
20884 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20885 __pyx_v___pyx_result = __pyx_t_3;
20895 __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
20896 __pyx_t_6 = (__pyx_t_1 != 0);
20906 if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
20907 __pyx_t_3 = __pyx_unpickle_Enum__set_state(((
struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state));
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error)
20908 __Pyx_GOTREF(__pyx_t_3);
20909 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20927 __Pyx_XDECREF(__pyx_r);
20928 __Pyx_INCREF(__pyx_v___pyx_result);
20929 __pyx_r = __pyx_v___pyx_result;
20940 __Pyx_XDECREF(__pyx_t_2);
20941 __Pyx_XDECREF(__pyx_t_3);
20942 __Pyx_XDECREF(__pyx_t_4);
20943 __Pyx_XDECREF(__pyx_t_5);
20944 __Pyx_AddTraceback(
"View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
20947 __Pyx_XDECREF(__pyx_v___pyx_PickleError);
20948 __Pyx_XDECREF(__pyx_v___pyx_result);
20949 __Pyx_XGIVEREF(__pyx_r);
20950 __Pyx_TraceReturn(__pyx_r, 0);
20951 __Pyx_RefNannyFinishContext();
20963 static PyObject *__pyx_unpickle_Enum__set_state(
struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
20964 PyObject *__pyx_r = NULL;
20965 __Pyx_TraceDeclarations
20966 __Pyx_RefNannyDeclarations
20967 PyObject *__pyx_t_1 = NULL;
20969 Py_ssize_t __pyx_t_3;
20972 PyObject *__pyx_t_6 = NULL;
20973 PyObject *__pyx_t_7 = NULL;
20974 PyObject *__pyx_t_8 = NULL;
20975 int __pyx_lineno = 0;
20976 const char *__pyx_filename = NULL;
20977 int __pyx_clineno = 0;
20978 __Pyx_RefNannySetupContext(
"__pyx_unpickle_Enum__set_state", 0);
20979 __Pyx_TraceCall(
"__pyx_unpickle_Enum__set_state", __pyx_f[1], 11, 0, __PYX_ERR(1, 11, __pyx_L1_error));
20988 if (unlikely(__pyx_v___pyx_state == Py_None)) {
20989 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
20990 __PYX_ERR(1, 12, __pyx_L1_error)
20992 __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
20993 __Pyx_GOTREF(__pyx_t_1);
20994 __Pyx_GIVEREF(__pyx_t_1);
20995 __Pyx_GOTREF(__pyx_v___pyx_result->name);
20996 __Pyx_DECREF(__pyx_v___pyx_result->name);
20997 __pyx_v___pyx_result->name = __pyx_t_1;
21006 if (unlikely(__pyx_v___pyx_state == Py_None)) {
21007 PyErr_SetString(PyExc_TypeError,
"object of type 'NoneType' has no len()");
21008 __PYX_ERR(1, 13, __pyx_L1_error)
21010 __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state);
if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
21011 __pyx_t_4 = ((__pyx_t_3 > 1) != 0);
21014 __pyx_t_2 = __pyx_t_4;
21015 goto __pyx_L4_bool_binop_done;
21017 __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict);
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
21018 __pyx_t_5 = (__pyx_t_4 != 0);
21019 __pyx_t_2 = __pyx_t_5;
21020 __pyx_L4_bool_binop_done:;
21028 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
21029 __Pyx_GOTREF(__pyx_t_6);
21030 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)
21031 __Pyx_GOTREF(__pyx_t_7);
21032 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21033 if (unlikely(__pyx_v___pyx_state == Py_None)) {
21034 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
21035 __PYX_ERR(1, 14, __pyx_L1_error)
21037 __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
21038 __Pyx_GOTREF(__pyx_t_6);
21040 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
21041 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
21042 if (likely(__pyx_t_8)) {
21043 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_7);
21044 __Pyx_INCREF(__pyx_t_8);
21045 __Pyx_INCREF(
function);
21046 __Pyx_DECREF_SET(__pyx_t_7,
function);
21049 __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
21050 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
21051 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21052 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
21053 __Pyx_GOTREF(__pyx_t_1);
21054 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
21055 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21074 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
21077 __Pyx_XDECREF(__pyx_t_1);
21078 __Pyx_XDECREF(__pyx_t_6);
21079 __Pyx_XDECREF(__pyx_t_7);
21080 __Pyx_XDECREF(__pyx_t_8);
21081 __Pyx_AddTraceback(
"View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
21084 __Pyx_XGIVEREF(__pyx_r);
21085 __Pyx_TraceReturn(__pyx_r, 0);
21086 __Pyx_RefNannyFinishContext();
21090 static PyObject *__pyx_tp_new_18BoundaryConditions_BC_Base(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
21091 struct __pyx_obj_18BoundaryConditions_BC_Base *p;
21093 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21094 o = (*t->tp_alloc)(t, 0);
21096 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21098 if (unlikely(!o))
return 0;
21099 p = ((
struct __pyx_obj_18BoundaryConditions_BC_Base *)o);
21100 p->Shape = Py_None; Py_INCREF(Py_None);
21101 p->name = ((PyObject*)Py_None); Py_INCREF(Py_None);
21102 p->BC_type = ((PyObject*)Py_None); Py_INCREF(Py_None);
21103 p->ct = Py_None; Py_INCREF(Py_None);
21104 p->_b_or.data = NULL;
21105 p->_b_or.memview = NULL;
21109 static void __pyx_tp_dealloc_18BoundaryConditions_BC_Base(PyObject *o) {
21110 struct __pyx_obj_18BoundaryConditions_BC_Base *p = (
struct __pyx_obj_18BoundaryConditions_BC_Base *)o;
21111 #if CYTHON_USE_TP_FINALIZE
21112 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
21113 if (PyObject_CallFinalizerFromDealloc(o))
return;
21116 PyObject_GC_UnTrack(o);
21117 Py_CLEAR(p->Shape);
21119 Py_CLEAR(p->BC_type);
21121 __PYX_XDEC_MEMVIEW(&p->_b_or, 1);
21122 (*Py_TYPE(o)->tp_free)(o);
21125 static int __pyx_tp_traverse_18BoundaryConditions_BC_Base(PyObject *o, visitproc
v,
void *a) {
21127 struct __pyx_obj_18BoundaryConditions_BC_Base *p = (
struct __pyx_obj_18BoundaryConditions_BC_Base *)o;
21129 e = (*v)(p->Shape, a);
if (e)
return e;
21132 e = (*v)(p->ct, a);
if (e)
return e;
21137 static int __pyx_tp_clear_18BoundaryConditions_BC_Base(PyObject *o) {
21139 struct __pyx_obj_18BoundaryConditions_BC_Base *p = (
struct __pyx_obj_18BoundaryConditions_BC_Base *)o;
21140 tmp = ((PyObject*)p->Shape);
21141 p->Shape = Py_None; Py_INCREF(Py_None);
21143 tmp = ((PyObject*)p->ct);
21144 p->ct = Py_None; Py_INCREF(Py_None);
21149 static PyObject *__pyx_getprop_18BoundaryConditions_7BC_Base_nd(PyObject *o, CYTHON_UNUSED
void *x) {
21150 return __pyx_pw_18BoundaryConditions_7BC_Base_2nd_1__get__(o);
21153 static int __pyx_setprop_18BoundaryConditions_7BC_Base_nd(PyObject *o, PyObject *
v, CYTHON_UNUSED
void *x) {
21155 return __pyx_pw_18BoundaryConditions_7BC_Base_2nd_3__set__(o,
v);
21158 PyErr_SetString(PyExc_NotImplementedError,
"__del__");
21163 static PyObject *__pyx_getprop_18BoundaryConditions_7BC_Base_Shape(PyObject *o, CYTHON_UNUSED
void *x) {
21164 return __pyx_pw_18BoundaryConditions_7BC_Base_5Shape_1__get__(o);
21167 static int __pyx_setprop_18BoundaryConditions_7BC_Base_Shape(PyObject *o, PyObject *
v, CYTHON_UNUSED
void *x) {
21169 return __pyx_pw_18BoundaryConditions_7BC_Base_5Shape_3__set__(o,
v);
21172 return __pyx_pw_18BoundaryConditions_7BC_Base_5Shape_5__del__(o);
21176 static PyObject *__pyx_getprop_18BoundaryConditions_7BC_Base_name(PyObject *o, CYTHON_UNUSED
void *x) {
21177 return __pyx_pw_18BoundaryConditions_7BC_Base_4name_1__get__(o);
21180 static int __pyx_setprop_18BoundaryConditions_7BC_Base_name(PyObject *o, PyObject *
v, CYTHON_UNUSED
void *x) {
21182 return __pyx_pw_18BoundaryConditions_7BC_Base_4name_3__set__(o,
v);
21185 return __pyx_pw_18BoundaryConditions_7BC_Base_4name_5__del__(o);
21189 static PyObject *__pyx_getprop_18BoundaryConditions_7BC_Base_BC_type(PyObject *o, CYTHON_UNUSED
void *x) {
21190 return __pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_1__get__(o);
21193 static int __pyx_setprop_18BoundaryConditions_7BC_Base_BC_type(PyObject *o, PyObject *
v, CYTHON_UNUSED
void *x) {
21195 return __pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_3__set__(o,
v);
21198 return __pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_5__del__(o);
21202 static PyObject *__pyx_getprop_18BoundaryConditions_7BC_Base_ct(PyObject *o, CYTHON_UNUSED
void *x) {
21203 return __pyx_pw_18BoundaryConditions_7BC_Base_2ct_1__get__(o);
21206 static int __pyx_setprop_18BoundaryConditions_7BC_Base_ct(PyObject *o, PyObject *
v, CYTHON_UNUSED
void *x) {
21208 return __pyx_pw_18BoundaryConditions_7BC_Base_2ct_3__set__(o,
v);
21211 return __pyx_pw_18BoundaryConditions_7BC_Base_2ct_5__del__(o);
21215 static PyMethodDef __pyx_methods_18BoundaryConditions_BC_Base[] = {
21216 {
"getContext", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_18BoundaryConditions_7BC_Base_3getContext, METH_VARARGS|METH_KEYWORDS, __pyx_doc_18BoundaryConditions_7BC_Base_2getContext},
21217 {
"__reduce_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_7BC_Base_5__reduce_cython__, METH_NOARGS, __pyx_doc_18BoundaryConditions_7BC_Base_4__reduce_cython__},
21218 {
"__setstate_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_7BC_Base_7__setstate_cython__, METH_O, __pyx_doc_18BoundaryConditions_7BC_Base_6__setstate_cython__},
21222 static struct PyGetSetDef __pyx_getsets_18BoundaryConditions_BC_Base[] = {
21223 {(
char *)
"nd", __pyx_getprop_18BoundaryConditions_7BC_Base_nd, __pyx_setprop_18BoundaryConditions_7BC_Base_nd, (
char *)
"nd: 'int'", 0},
21224 {(
char *)
"Shape", __pyx_getprop_18BoundaryConditions_7BC_Base_Shape, __pyx_setprop_18BoundaryConditions_7BC_Base_Shape, (
char *)
"Shape: object", 0},
21225 {(
char *)
"name", __pyx_getprop_18BoundaryConditions_7BC_Base_name, __pyx_setprop_18BoundaryConditions_7BC_Base_name, (
char *)
"name: str", 0},
21226 {(
char *)
"BC_type", __pyx_getprop_18BoundaryConditions_7BC_Base_BC_type, __pyx_setprop_18BoundaryConditions_7BC_Base_BC_type, (
char *)
"BC_type: str", 0},
21227 {(
char *)
"ct", __pyx_getprop_18BoundaryConditions_7BC_Base_ct, __pyx_setprop_18BoundaryConditions_7BC_Base_ct, (
char *)
"ct: object", 0},
21231 static PyTypeObject __pyx_type_18BoundaryConditions_BC_Base = {
21232 PyVarObject_HEAD_INIT(0, 0)
21233 "BoundaryConditions.BC_Base",
21234 sizeof(
struct __pyx_obj_18BoundaryConditions_BC_Base),
21236 __pyx_tp_dealloc_18BoundaryConditions_BC_Base,
21237 #if PY_VERSION_HEX < 0x030800b4
21240 #if PY_VERSION_HEX >= 0x030800b4
21245 #if PY_MAJOR_VERSION < 3
21248 #if PY_MAJOR_VERSION >= 3
21261 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
21262 "BC_Base(shape=None, name=None, b_or=None, b_i=0, nd=None)\n\n Generic class regrouping boundary conditions\n ",
21263 __pyx_tp_traverse_18BoundaryConditions_BC_Base,
21264 __pyx_tp_clear_18BoundaryConditions_BC_Base,
21269 __pyx_methods_18BoundaryConditions_BC_Base,
21271 __pyx_getsets_18BoundaryConditions_BC_Base,
21277 __pyx_pw_18BoundaryConditions_7BC_Base_1__init__,
21279 __pyx_tp_new_18BoundaryConditions_BC_Base,
21289 #if PY_VERSION_HEX >= 0x030400a1
21292 #if PY_VERSION_HEX >= 0x030800b1
21295 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21299 static struct __pyx_vtabstruct_18BoundaryConditions_BoundaryCondition __pyx_vtable_18BoundaryConditions_BoundaryCondition;
21301 static PyObject *__pyx_tp_new_18BoundaryConditions_BoundaryCondition(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
21302 struct __pyx_obj_18BoundaryConditions_BoundaryCondition *p;
21304 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21305 o = (*t->tp_alloc)(t, 0);
21307 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21309 if (unlikely(!o))
return 0;
21310 p = ((
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)o);
21311 p->__pyx_vtab = __pyx_vtabptr_18BoundaryConditions_BoundaryCondition;
21312 p->uOfXT = Py_None; Py_INCREF(Py_None);
21316 static void __pyx_tp_dealloc_18BoundaryConditions_BoundaryCondition(PyObject *o) {
21317 struct __pyx_obj_18BoundaryConditions_BoundaryCondition *p = (
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)o;
21318 #if CYTHON_USE_TP_FINALIZE
21319 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
21320 if (PyObject_CallFinalizerFromDealloc(o))
return;
21323 PyObject_GC_UnTrack(o);
21324 Py_CLEAR(p->uOfXT);
21325 (*Py_TYPE(o)->tp_free)(o);
21328 static int __pyx_tp_traverse_18BoundaryConditions_BoundaryCondition(PyObject *o, visitproc
v,
void *a) {
21330 struct __pyx_obj_18BoundaryConditions_BoundaryCondition *p = (
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)o;
21332 e = (*v)(p->uOfXT, a);
if (e)
return e;
21337 static int __pyx_tp_clear_18BoundaryConditions_BoundaryCondition(PyObject *o) {
21339 struct __pyx_obj_18BoundaryConditions_BoundaryCondition *p = (
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)o;
21340 tmp = ((PyObject*)p->uOfXT);
21341 p->uOfXT = Py_None; Py_INCREF(Py_None);
21346 static PyObject *__pyx_getprop_18BoundaryConditions_17BoundaryCondition_uOfXT(PyObject *o, CYTHON_UNUSED
void *x) {
21347 return __pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_1__get__(o);
21350 static int __pyx_setprop_18BoundaryConditions_17BoundaryCondition_uOfXT(PyObject *o, PyObject *
v, CYTHON_UNUSED
void *x) {
21352 return __pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_3__set__(o,
v);
21355 return __pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_5__del__(o);
21359 static PyMethodDef __pyx_methods_18BoundaryConditions_BoundaryCondition[] = {
21360 {
"init_cython", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_3init_cython, METH_NOARGS, __pyx_doc_18BoundaryConditions_17BoundaryCondition_2init_cython},
21361 {
"setConstantBC", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_7setConstantBC, METH_O, __pyx_doc_18BoundaryConditions_17BoundaryCondition_6setConstantBC},
21362 {
"setLinearBC", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_18BoundaryConditions_17BoundaryCondition_9setLinearBC, METH_VARARGS|METH_KEYWORDS, __pyx_doc_18BoundaryConditions_17BoundaryCondition_8setLinearBC},
21363 {
"setLinearRamp", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_18BoundaryConditions_17BoundaryCondition_11setLinearRamp, METH_VARARGS|METH_KEYWORDS, __pyx_doc_18BoundaryConditions_17BoundaryCondition_10setLinearRamp},
21364 {
"__reduce_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_13__reduce_cython__, METH_NOARGS, __pyx_doc_18BoundaryConditions_17BoundaryCondition_12__reduce_cython__},
21365 {
"__setstate_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_15__setstate_cython__, METH_O, __pyx_doc_18BoundaryConditions_17BoundaryCondition_14__setstate_cython__},
21369 static struct PyGetSetDef __pyx_getsets_18BoundaryConditions_BoundaryCondition[] = {
21370 {(
char *)
"uOfXT", __pyx_getprop_18BoundaryConditions_17BoundaryCondition_uOfXT, __pyx_setprop_18BoundaryConditions_17BoundaryCondition_uOfXT, (
char *)
"uOfXT: object", 0},
21374 static PyTypeObject __pyx_type_18BoundaryConditions_BoundaryCondition = {
21375 PyVarObject_HEAD_INIT(0, 0)
21376 "BoundaryConditions.BoundaryCondition",
21377 sizeof(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition),
21379 __pyx_tp_dealloc_18BoundaryConditions_BoundaryCondition,
21380 #if PY_VERSION_HEX < 0x030800b4
21383 #if PY_VERSION_HEX >= 0x030800b4
21388 #if PY_MAJOR_VERSION < 3
21391 #if PY_MAJOR_VERSION >= 3
21404 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
21405 "BoundaryCondition()\n\n Boundary condition class\n\n Attributes\n ----------\n uOfXT: func or None\n boundary condition function of x (array_like) and t (float) or None for\n no boundary condition\n ",
21406 __pyx_tp_traverse_18BoundaryConditions_BoundaryCondition,
21407 __pyx_tp_clear_18BoundaryConditions_BoundaryCondition,
21412 __pyx_methods_18BoundaryConditions_BoundaryCondition,
21414 __pyx_getsets_18BoundaryConditions_BoundaryCondition,
21420 __pyx_pw_18BoundaryConditions_17BoundaryCondition_1__init__,
21422 __pyx_tp_new_18BoundaryConditions_BoundaryCondition,
21432 #if PY_VERSION_HEX >= 0x030400a1
21435 #if PY_VERSION_HEX >= 0x030800b1
21438 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21443 static struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *__pyx_freelist_18BoundaryConditions___pyx_scope_struct__setConstantBC[8];
21444 static int __pyx_freecount_18BoundaryConditions___pyx_scope_struct__setConstantBC = 0;
21446 static PyObject *__pyx_tp_new_18BoundaryConditions___pyx_scope_struct__setConstantBC(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
21448 if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_18BoundaryConditions___pyx_scope_struct__setConstantBC > 0) & (t->tp_basicsize ==
sizeof(
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC)))) {
21449 o = (PyObject*)__pyx_freelist_18BoundaryConditions___pyx_scope_struct__setConstantBC[--__pyx_freecount_18BoundaryConditions___pyx_scope_struct__setConstantBC];
21450 memset(o, 0,
sizeof(
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC));
21451 (void) PyObject_INIT(o, t);
21452 PyObject_GC_Track(o);
21454 o = (*t->tp_alloc)(t, 0);
21455 if (unlikely(!o))
return 0;
21460 static void __pyx_tp_dealloc_18BoundaryConditions___pyx_scope_struct__setConstantBC(PyObject *o) {
21461 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *p = (
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *)o;
21462 PyObject_GC_UnTrack(o);
21463 Py_CLEAR(p->__pyx_v_value);
21464 if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_18BoundaryConditions___pyx_scope_struct__setConstantBC < 8) & (Py_TYPE(o)->tp_basicsize ==
sizeof(
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC)))) {
21465 __pyx_freelist_18BoundaryConditions___pyx_scope_struct__setConstantBC[__pyx_freecount_18BoundaryConditions___pyx_scope_struct__setConstantBC++] = ((
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *)o);
21467 (*Py_TYPE(o)->tp_free)(o);
21471 static int __pyx_tp_traverse_18BoundaryConditions___pyx_scope_struct__setConstantBC(PyObject *o, visitproc
v,
void *a) {
21473 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *p = (
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *)o;
21474 if (p->__pyx_v_value) {
21475 e = (*v)(p->__pyx_v_value, a);
if (e)
return e;
21480 static int __pyx_tp_clear_18BoundaryConditions___pyx_scope_struct__setConstantBC(PyObject *o) {
21482 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *p = (
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *)o;
21483 tmp = ((PyObject*)p->__pyx_v_value);
21484 p->__pyx_v_value = Py_None; Py_INCREF(Py_None);
21489 static PyTypeObject __pyx_type_18BoundaryConditions___pyx_scope_struct__setConstantBC = {
21490 PyVarObject_HEAD_INIT(0, 0)
21491 "BoundaryConditions.__pyx_scope_struct__setConstantBC",
21492 sizeof(
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC),
21494 __pyx_tp_dealloc_18BoundaryConditions___pyx_scope_struct__setConstantBC,
21495 #if PY_VERSION_HEX < 0x030800b4
21498 #if PY_VERSION_HEX >= 0x030800b4
21503 #if PY_MAJOR_VERSION < 3
21506 #if PY_MAJOR_VERSION >= 3
21519 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
21521 __pyx_tp_traverse_18BoundaryConditions___pyx_scope_struct__setConstantBC,
21522 __pyx_tp_clear_18BoundaryConditions___pyx_scope_struct__setConstantBC,
21537 __pyx_tp_new_18BoundaryConditions___pyx_scope_struct__setConstantBC,
21547 #if PY_VERSION_HEX >= 0x030400a1
21550 #if PY_VERSION_HEX >= 0x030800b1
21553 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21558 static struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *__pyx_freelist_18BoundaryConditions___pyx_scope_struct_1_setLinearBC[8];
21559 static int __pyx_freecount_18BoundaryConditions___pyx_scope_struct_1_setLinearBC = 0;
21561 static PyObject *__pyx_tp_new_18BoundaryConditions___pyx_scope_struct_1_setLinearBC(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
21563 if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_18BoundaryConditions___pyx_scope_struct_1_setLinearBC > 0) & (t->tp_basicsize ==
sizeof(
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC)))) {
21564 o = (PyObject*)__pyx_freelist_18BoundaryConditions___pyx_scope_struct_1_setLinearBC[--__pyx_freecount_18BoundaryConditions___pyx_scope_struct_1_setLinearBC];
21565 memset(o, 0,
sizeof(
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC));
21566 (void) PyObject_INIT(o, t);
21567 PyObject_GC_Track(o);
21569 o = (*t->tp_alloc)(t, 0);
21570 if (unlikely(!o))
return 0;
21575 static void __pyx_tp_dealloc_18BoundaryConditions___pyx_scope_struct_1_setLinearBC(PyObject *o) {
21576 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *p = (
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *)o;
21577 PyObject_GC_UnTrack(o);
21578 Py_CLEAR(p->__pyx_v_a);
21579 Py_CLEAR(p->__pyx_v_a0);
21580 if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_18BoundaryConditions___pyx_scope_struct_1_setLinearBC < 8) & (Py_TYPE(o)->tp_basicsize ==
sizeof(
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC)))) {
21581 __pyx_freelist_18BoundaryConditions___pyx_scope_struct_1_setLinearBC[__pyx_freecount_18BoundaryConditions___pyx_scope_struct_1_setLinearBC++] = ((
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *)o);
21583 (*Py_TYPE(o)->tp_free)(o);
21587 static int __pyx_tp_traverse_18BoundaryConditions___pyx_scope_struct_1_setLinearBC(PyObject *o, visitproc
v,
void *a) {
21589 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *p = (
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *)o;
21590 if (p->__pyx_v_a) {
21591 e = (*v)(p->__pyx_v_a, a);
if (e)
return e;
21593 if (p->__pyx_v_a0) {
21594 e = (*v)(p->__pyx_v_a0, a);
if (e)
return e;
21599 static int __pyx_tp_clear_18BoundaryConditions___pyx_scope_struct_1_setLinearBC(PyObject *o) {
21601 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *p = (
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *)o;
21602 tmp = ((PyObject*)p->__pyx_v_a);
21603 p->__pyx_v_a = Py_None; Py_INCREF(Py_None);
21605 tmp = ((PyObject*)p->__pyx_v_a0);
21606 p->__pyx_v_a0 = Py_None; Py_INCREF(Py_None);
21611 static PyTypeObject __pyx_type_18BoundaryConditions___pyx_scope_struct_1_setLinearBC = {
21612 PyVarObject_HEAD_INIT(0, 0)
21613 "BoundaryConditions.__pyx_scope_struct_1_setLinearBC",
21614 sizeof(
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC),
21616 __pyx_tp_dealloc_18BoundaryConditions___pyx_scope_struct_1_setLinearBC,
21617 #if PY_VERSION_HEX < 0x030800b4
21620 #if PY_VERSION_HEX >= 0x030800b4
21625 #if PY_MAJOR_VERSION < 3
21628 #if PY_MAJOR_VERSION >= 3
21641 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
21643 __pyx_tp_traverse_18BoundaryConditions___pyx_scope_struct_1_setLinearBC,
21644 __pyx_tp_clear_18BoundaryConditions___pyx_scope_struct_1_setLinearBC,
21659 __pyx_tp_new_18BoundaryConditions___pyx_scope_struct_1_setLinearBC,
21669 #if PY_VERSION_HEX >= 0x030400a1
21672 #if PY_VERSION_HEX >= 0x030800b1
21675 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21680 static struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *__pyx_freelist_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp[8];
21681 static int __pyx_freecount_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp = 0;
21683 static PyObject *__pyx_tp_new_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
21685 if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp > 0) & (t->tp_basicsize ==
sizeof(
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp)))) {
21686 o = (PyObject*)__pyx_freelist_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp[--__pyx_freecount_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp];
21687 memset(o, 0,
sizeof(
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp));
21688 (void) PyObject_INIT(o, t);
21689 PyObject_GC_Track(o);
21691 o = (*t->tp_alloc)(t, 0);
21692 if (unlikely(!o))
return 0;
21697 static void __pyx_tp_dealloc_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp(PyObject *o) {
21698 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *p = (
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *)o;
21699 PyObject_GC_UnTrack(o);
21700 Py_CLEAR(p->__pyx_v_t1);
21701 Py_CLEAR(p->__pyx_v_value);
21702 if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp < 8) & (Py_TYPE(o)->tp_basicsize ==
sizeof(
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp)))) {
21703 __pyx_freelist_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp[__pyx_freecount_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp++] = ((
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *)o);
21705 (*Py_TYPE(o)->tp_free)(o);
21709 static int __pyx_tp_traverse_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp(PyObject *o, visitproc
v,
void *a) {
21711 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *p = (
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *)o;
21712 if (p->__pyx_v_t1) {
21713 e = (*v)(p->__pyx_v_t1, a);
if (e)
return e;
21715 if (p->__pyx_v_value) {
21716 e = (*v)(p->__pyx_v_value, a);
if (e)
return e;
21721 static int __pyx_tp_clear_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp(PyObject *o) {
21723 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *p = (
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *)o;
21724 tmp = ((PyObject*)p->__pyx_v_t1);
21725 p->__pyx_v_t1 = Py_None; Py_INCREF(Py_None);
21727 tmp = ((PyObject*)p->__pyx_v_value);
21728 p->__pyx_v_value = Py_None; Py_INCREF(Py_None);
21733 static PyTypeObject __pyx_type_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp = {
21734 PyVarObject_HEAD_INIT(0, 0)
21735 "BoundaryConditions.__pyx_scope_struct_2_setLinearRamp",
21736 sizeof(
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp),
21738 __pyx_tp_dealloc_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp,
21739 #if PY_VERSION_HEX < 0x030800b4
21742 #if PY_VERSION_HEX >= 0x030800b4
21747 #if PY_MAJOR_VERSION < 3
21750 #if PY_MAJOR_VERSION >= 3
21763 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
21765 __pyx_tp_traverse_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp,
21766 __pyx_tp_clear_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp,
21781 __pyx_tp_new_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp,
21791 #if PY_VERSION_HEX >= 0x030400a1
21794 #if PY_VERSION_HEX >= 0x030800b1
21797 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21801 static struct __pyx_vtabstruct_array __pyx_vtable_array;
21803 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
21804 struct __pyx_array_obj *p;
21806 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21807 o = (*t->tp_alloc)(t, 0);
21809 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21811 if (unlikely(!o))
return 0;
21812 p = ((
struct __pyx_array_obj *)o);
21813 p->__pyx_vtab = __pyx_vtabptr_array;
21814 p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
21815 p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
21816 if (unlikely(__pyx_array___cinit__(o, a, k) < 0))
goto bad;
21819 Py_DECREF(o); o = 0;
21823 static void __pyx_tp_dealloc_array(PyObject *o) {
21824 struct __pyx_array_obj *p = (
struct __pyx_array_obj *)o;
21825 #if CYTHON_USE_TP_FINALIZE
21826 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
21827 if (PyObject_CallFinalizerFromDealloc(o))
return;
21831 PyObject *etype, *eval, *etb;
21832 PyErr_Fetch(&etype, &eval, &etb);
21833 __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
21834 __pyx_array___dealloc__(o);
21835 __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
21836 PyErr_Restore(etype, eval, etb);
21839 Py_CLEAR(p->_format);
21840 (*Py_TYPE(o)->tp_free)(o);
21842 static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
21844 PyObject *x = PyInt_FromSsize_t(i);
if(!x)
return 0;
21845 r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
21850 static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *
v) {
21852 return __pyx_array___setitem__(o, i,
v);
21855 PyErr_Format(PyExc_NotImplementedError,
21856 "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
21861 static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *
n) {
21862 PyObject *
v = __Pyx_PyObject_GenericGetAttr(o,
n);
21863 if (!
v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
21865 v = __pyx_array___getattr__(o,
n);
21870 static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED
void *x) {
21871 return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
21874 static PyMethodDef __pyx_methods_array[] = {
21875 {
"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
21876 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0},
21877 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0},
21881 static struct PyGetSetDef __pyx_getsets_array[] = {
21882 {(
char *)
"memview", __pyx_getprop___pyx_array_memview, 0, (
char *)0, 0},
21886 static PySequenceMethods __pyx_tp_as_sequence_array = {
21887 __pyx_array___len__,
21890 __pyx_sq_item_array,
21899 static PyMappingMethods __pyx_tp_as_mapping_array = {
21900 __pyx_array___len__,
21901 __pyx_array___getitem__,
21902 __pyx_mp_ass_subscript_array,
21905 static PyBufferProcs __pyx_tp_as_buffer_array = {
21906 #if PY_MAJOR_VERSION < 3
21909 #if PY_MAJOR_VERSION < 3
21912 #if PY_MAJOR_VERSION < 3
21915 #if PY_MAJOR_VERSION < 3
21918 __pyx_array_getbuffer,
21922 static PyTypeObject __pyx_type___pyx_array = {
21923 PyVarObject_HEAD_INIT(0, 0)
21924 "BoundaryConditions.array",
21925 sizeof(
struct __pyx_array_obj),
21927 __pyx_tp_dealloc_array,
21928 #if PY_VERSION_HEX < 0x030800b4
21931 #if PY_VERSION_HEX >= 0x030800b4
21936 #if PY_MAJOR_VERSION < 3
21939 #if PY_MAJOR_VERSION >= 3
21944 &__pyx_tp_as_sequence_array,
21945 &__pyx_tp_as_mapping_array,
21949 __pyx_tp_getattro_array,
21951 &__pyx_tp_as_buffer_array,
21952 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
21960 __pyx_methods_array,
21962 __pyx_getsets_array,
21970 __pyx_tp_new_array,
21980 #if PY_VERSION_HEX >= 0x030400a1
21983 #if PY_VERSION_HEX >= 0x030800b1
21986 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21991 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
21992 struct __pyx_MemviewEnum_obj *p;
21994 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21995 o = (*t->tp_alloc)(t, 0);
21997 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21999 if (unlikely(!o))
return 0;
22000 p = ((
struct __pyx_MemviewEnum_obj *)o);
22001 p->name = Py_None; Py_INCREF(Py_None);
22005 static void __pyx_tp_dealloc_Enum(PyObject *o) {
22006 struct __pyx_MemviewEnum_obj *p = (
struct __pyx_MemviewEnum_obj *)o;
22007 #if CYTHON_USE_TP_FINALIZE
22008 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
22009 if (PyObject_CallFinalizerFromDealloc(o))
return;
22012 PyObject_GC_UnTrack(o);
22014 (*Py_TYPE(o)->tp_free)(o);
22017 static int __pyx_tp_traverse_Enum(PyObject *o, visitproc
v,
void *a) {
22019 struct __pyx_MemviewEnum_obj *p = (
struct __pyx_MemviewEnum_obj *)o;
22021 e = (*v)(p->name, a);
if (e)
return e;
22026 static int __pyx_tp_clear_Enum(PyObject *o) {
22028 struct __pyx_MemviewEnum_obj *p = (
struct __pyx_MemviewEnum_obj *)o;
22029 tmp = ((PyObject*)p->name);
22030 p->name = Py_None; Py_INCREF(Py_None);
22035 static PyMethodDef __pyx_methods_Enum[] = {
22036 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0},
22037 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0},
22041 static PyTypeObject __pyx_type___pyx_MemviewEnum = {
22042 PyVarObject_HEAD_INIT(0, 0)
22043 "BoundaryConditions.Enum",
22044 sizeof(
struct __pyx_MemviewEnum_obj),
22046 __pyx_tp_dealloc_Enum,
22047 #if PY_VERSION_HEX < 0x030800b4
22050 #if PY_VERSION_HEX >= 0x030800b4
22055 #if PY_MAJOR_VERSION < 3
22058 #if PY_MAJOR_VERSION >= 3
22061 __pyx_MemviewEnum___repr__,
22071 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
22073 __pyx_tp_traverse_Enum,
22074 __pyx_tp_clear_Enum,
22079 __pyx_methods_Enum,
22087 __pyx_MemviewEnum___init__,
22099 #if PY_VERSION_HEX >= 0x030400a1
22102 #if PY_VERSION_HEX >= 0x030800b1
22105 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
22109 static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
22111 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
22112 struct __pyx_memoryview_obj *p;
22114 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
22115 o = (*t->tp_alloc)(t, 0);
22117 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
22119 if (unlikely(!o))
return 0;
22120 p = ((
struct __pyx_memoryview_obj *)o);
22121 p->__pyx_vtab = __pyx_vtabptr_memoryview;
22122 p->obj = Py_None; Py_INCREF(Py_None);
22123 p->_size = Py_None; Py_INCREF(Py_None);
22124 p->_array_interface = Py_None; Py_INCREF(Py_None);
22125 p->view.obj = NULL;
22126 if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0))
goto bad;
22129 Py_DECREF(o); o = 0;
22133 static void __pyx_tp_dealloc_memoryview(PyObject *o) {
22134 struct __pyx_memoryview_obj *p = (
struct __pyx_memoryview_obj *)o;
22135 #if CYTHON_USE_TP_FINALIZE
22136 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
22137 if (PyObject_CallFinalizerFromDealloc(o))
return;
22140 PyObject_GC_UnTrack(o);
22142 PyObject *etype, *eval, *etb;
22143 PyErr_Fetch(&etype, &eval, &etb);
22144 __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
22145 __pyx_memoryview___dealloc__(o);
22146 __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
22147 PyErr_Restore(etype, eval, etb);
22150 Py_CLEAR(p->_size);
22151 Py_CLEAR(p->_array_interface);
22152 (*Py_TYPE(o)->tp_free)(o);
22155 static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc
v,
void *a) {
22157 struct __pyx_memoryview_obj *p = (
struct __pyx_memoryview_obj *)o;
22159 e = (*v)(p->obj, a);
if (e)
return e;
22162 e = (*v)(p->_size, a);
if (e)
return e;
22164 if (p->_array_interface) {
22165 e = (*v)(p->_array_interface, a);
if (e)
return e;
22168 e = (*v)(p->view.obj, a);
if (e)
return e;
22173 static int __pyx_tp_clear_memoryview(PyObject *o) {
22175 struct __pyx_memoryview_obj *p = (
struct __pyx_memoryview_obj *)o;
22176 tmp = ((PyObject*)p->obj);
22177 p->obj = Py_None; Py_INCREF(Py_None);
22179 tmp = ((PyObject*)p->_size);
22180 p->_size = Py_None; Py_INCREF(Py_None);
22182 tmp = ((PyObject*)p->_array_interface);
22183 p->_array_interface = Py_None; Py_INCREF(Py_None);
22185 Py_CLEAR(p->view.obj);
22188 static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
22190 PyObject *x = PyInt_FromSsize_t(i);
if(!x)
return 0;
22191 r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
22196 static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *
v) {
22198 return __pyx_memoryview___setitem__(o, i,
v);
22201 PyErr_Format(PyExc_NotImplementedError,
22202 "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
22207 static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED
void *x) {
22208 return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
22211 static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED
void *x) {
22212 return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
22215 static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED
void *x) {
22216 return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
22219 static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED
void *x) {
22220 return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
22223 static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED
void *x) {
22224 return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
22227 static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED
void *x) {
22228 return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
22231 static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED
void *x) {
22232 return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
22235 static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED
void *x) {
22236 return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
22239 static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED
void *x) {
22240 return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
22243 static PyMethodDef __pyx_methods_memoryview[] = {
22244 {
"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0},
22245 {
"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0},
22246 {
"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0},
22247 {
"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0},
22248 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0},
22249 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0},
22253 static struct PyGetSetDef __pyx_getsets_memoryview[] = {
22254 {(
char *)
"T", __pyx_getprop___pyx_memoryview_T, 0, (
char *)0, 0},
22255 {(
char *)
"base", __pyx_getprop___pyx_memoryview_base, 0, (
char *)0, 0},
22256 {(
char *)
"shape", __pyx_getprop___pyx_memoryview_shape, 0, (
char *)0, 0},
22257 {(
char *)
"strides", __pyx_getprop___pyx_memoryview_strides, 0, (
char *)0, 0},
22258 {(
char *)
"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (
char *)0, 0},
22259 {(
char *)
"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (
char *)0, 0},
22260 {(
char *)
"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (
char *)0, 0},
22261 {(
char *)
"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (
char *)0, 0},
22262 {(
char *)
"size", __pyx_getprop___pyx_memoryview_size, 0, (
char *)0, 0},
22266 static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
22267 __pyx_memoryview___len__,
22270 __pyx_sq_item_memoryview,
22279 static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
22280 __pyx_memoryview___len__,
22281 __pyx_memoryview___getitem__,
22282 __pyx_mp_ass_subscript_memoryview,
22285 static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
22286 #if PY_MAJOR_VERSION < 3
22289 #if PY_MAJOR_VERSION < 3
22292 #if PY_MAJOR_VERSION < 3
22295 #if PY_MAJOR_VERSION < 3
22298 __pyx_memoryview_getbuffer,
22302 static PyTypeObject __pyx_type___pyx_memoryview = {
22303 PyVarObject_HEAD_INIT(0, 0)
22304 "BoundaryConditions.memoryview",
22305 sizeof(
struct __pyx_memoryview_obj),
22307 __pyx_tp_dealloc_memoryview,
22308 #if PY_VERSION_HEX < 0x030800b4
22311 #if PY_VERSION_HEX >= 0x030800b4
22316 #if PY_MAJOR_VERSION < 3
22319 #if PY_MAJOR_VERSION >= 3
22322 __pyx_memoryview___repr__,
22324 &__pyx_tp_as_sequence_memoryview,
22325 &__pyx_tp_as_mapping_memoryview,
22328 __pyx_memoryview___str__,
22331 &__pyx_tp_as_buffer_memoryview,
22332 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
22334 __pyx_tp_traverse_memoryview,
22335 __pyx_tp_clear_memoryview,
22340 __pyx_methods_memoryview,
22342 __pyx_getsets_memoryview,
22350 __pyx_tp_new_memoryview,
22360 #if PY_VERSION_HEX >= 0x030400a1
22363 #if PY_VERSION_HEX >= 0x030800b1
22366 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
22370 static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
22372 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
22373 struct __pyx_memoryviewslice_obj *p;
22374 PyObject *o = __pyx_tp_new_memoryview(t, a, k);
22375 if (unlikely(!o))
return 0;
22376 p = ((
struct __pyx_memoryviewslice_obj *)o);
22377 p->__pyx_base.__pyx_vtab = (
struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
22378 p->from_object = Py_None; Py_INCREF(Py_None);
22379 p->from_slice.memview = NULL;
22383 static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
22384 struct __pyx_memoryviewslice_obj *p = (
struct __pyx_memoryviewslice_obj *)o;
22385 #if CYTHON_USE_TP_FINALIZE
22386 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
22387 if (PyObject_CallFinalizerFromDealloc(o))
return;
22390 PyObject_GC_UnTrack(o);
22392 PyObject *etype, *eval, *etb;
22393 PyErr_Fetch(&etype, &eval, &etb);
22394 __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
22395 __pyx_memoryviewslice___dealloc__(o);
22396 __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
22397 PyErr_Restore(etype, eval, etb);
22399 Py_CLEAR(p->from_object);
22400 PyObject_GC_Track(o);
22401 __pyx_tp_dealloc_memoryview(o);
22404 static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc
v,
void *a) {
22406 struct __pyx_memoryviewslice_obj *p = (
struct __pyx_memoryviewslice_obj *)o;
22407 e = __pyx_tp_traverse_memoryview(o,
v, a);
if (e)
return e;
22408 if (p->from_object) {
22409 e = (*v)(p->from_object, a);
if (e)
return e;
22414 static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
22416 struct __pyx_memoryviewslice_obj *p = (
struct __pyx_memoryviewslice_obj *)o;
22417 __pyx_tp_clear_memoryview(o);
22418 tmp = ((PyObject*)p->from_object);
22419 p->from_object = Py_None; Py_INCREF(Py_None);
22421 __PYX_XDEC_MEMVIEW(&p->from_slice, 1);
22425 static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED
void *x) {
22426 return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o);
22429 static PyMethodDef __pyx_methods__memoryviewslice[] = {
22430 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0},
22431 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0},
22435 static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = {
22436 {(
char *)
"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (
char *)0, 0},
22440 static PyTypeObject __pyx_type___pyx_memoryviewslice = {
22441 PyVarObject_HEAD_INIT(0, 0)
22442 "BoundaryConditions._memoryviewslice",
22443 sizeof(
struct __pyx_memoryviewslice_obj),
22445 __pyx_tp_dealloc__memoryviewslice,
22446 #if PY_VERSION_HEX < 0x030800b4
22449 #if PY_VERSION_HEX >= 0x030800b4
22454 #if PY_MAJOR_VERSION < 3
22457 #if PY_MAJOR_VERSION >= 3
22460 #if CYTHON_COMPILING_IN_PYPY
22461 __pyx_memoryview___repr__,
22470 #if CYTHON_COMPILING_IN_PYPY
22471 __pyx_memoryview___str__,
22478 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
22479 "Internal class for passing memoryview slices to Python",
22480 __pyx_tp_traverse__memoryviewslice,
22481 __pyx_tp_clear__memoryviewslice,
22486 __pyx_methods__memoryviewslice,
22488 __pyx_getsets__memoryviewslice,
22496 __pyx_tp_new__memoryviewslice,
22506 #if PY_VERSION_HEX >= 0x030400a1
22509 #if PY_VERSION_HEX >= 0x030800b1
22512 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
22517 static PyMethodDef __pyx_methods[] = {
22521 #if PY_MAJOR_VERSION >= 3
22522 #if CYTHON_PEP489_MULTI_PHASE_INIT
22523 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def);
22524 static int __pyx_pymod_exec_BoundaryConditions(PyObject* module);
22525 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
22526 {Py_mod_create, (
void*)__pyx_pymod_create},
22527 {Py_mod_exec, (
void*)__pyx_pymod_exec_BoundaryConditions},
22532 static struct PyModuleDef __pyx_moduledef = {
22533 PyModuleDef_HEAD_INIT,
22534 "BoundaryConditions",
22536 #if CYTHON_PEP489_MULTI_PHASE_INIT
22542 #if CYTHON_PEP489_MULTI_PHASE_INIT
22543 __pyx_moduledef_slots,
22552 #ifndef CYTHON_SMALL_CODE
22553 #if defined(__clang__)
22554 #define CYTHON_SMALL_CODE
22555 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
22556 #define CYTHON_SMALL_CODE __attribute__((cold))
22558 #define CYTHON_SMALL_CODE
22562 static __Pyx_StringTabEntry __pyx_string_tab[] = {
22563 {&__pyx_n_s_ASCII, __pyx_k_ASCII,
sizeof(__pyx_k_ASCII), 0, 0, 1, 1},
22564 {&__pyx_n_s_BC_Base, __pyx_k_BC_Base,
sizeof(__pyx_k_BC_Base), 0, 0, 1, 1},
22565 {&__pyx_n_s_BC_Base___reduce_cython, __pyx_k_BC_Base___reduce_cython,
sizeof(__pyx_k_BC_Base___reduce_cython), 0, 0, 1, 1},
22566 {&__pyx_n_s_BC_Base___setstate_cython, __pyx_k_BC_Base___setstate_cython,
sizeof(__pyx_k_BC_Base___setstate_cython), 0, 0, 1, 1},
22567 {&__pyx_n_s_BC_Base_getContext, __pyx_k_BC_Base_getContext,
sizeof(__pyx_k_BC_Base_getContext), 0, 0, 1, 1},
22568 {&__pyx_n_s_BoundaryCondition, __pyx_k_BoundaryCondition,
sizeof(__pyx_k_BoundaryCondition), 0, 0, 1, 1},
22569 {&__pyx_n_s_BoundaryCondition___reduce_cytho, __pyx_k_BoundaryCondition___reduce_cytho,
sizeof(__pyx_k_BoundaryCondition___reduce_cytho), 0, 0, 1, 1},
22570 {&__pyx_n_s_BoundaryCondition___setstate_cyt, __pyx_k_BoundaryCondition___setstate_cyt,
sizeof(__pyx_k_BoundaryCondition___setstate_cyt), 0, 0, 1, 1},
22571 {&__pyx_n_s_BoundaryCondition_init_cython, __pyx_k_BoundaryCondition_init_cython,
sizeof(__pyx_k_BoundaryCondition_init_cython), 0, 0, 1, 1},
22572 {&__pyx_n_s_BoundaryCondition_resetBC, __pyx_k_BoundaryCondition_resetBC,
sizeof(__pyx_k_BoundaryCondition_resetBC), 0, 0, 1, 1},
22573 {&__pyx_n_s_BoundaryCondition_setConstantBC, __pyx_k_BoundaryCondition_setConstantBC,
sizeof(__pyx_k_BoundaryCondition_setConstantBC), 0, 0, 1, 1},
22574 {&__pyx_n_s_BoundaryCondition_setLinearBC, __pyx_k_BoundaryCondition_setLinearBC,
sizeof(__pyx_k_BoundaryCondition_setLinearBC), 0, 0, 1, 1},
22575 {&__pyx_n_s_BoundaryCondition_setLinearRamp, __pyx_k_BoundaryCondition_setLinearRamp,
sizeof(__pyx_k_BoundaryCondition_setLinearRamp), 0, 0, 1, 1},
22576 {&__pyx_n_s_BoundaryConditions, __pyx_k_BoundaryConditions,
sizeof(__pyx_k_BoundaryConditions), 0, 0, 1, 1},
22577 {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri,
sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0},
22578 {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is,
sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0},
22579 {&__pyx_kp_s_Cannot_assign_to_read_only_memor, __pyx_k_Cannot_assign_to_read_only_memor,
sizeof(__pyx_k_Cannot_assign_to_read_only_memor), 0, 0, 1, 0},
22580 {&__pyx_kp_s_Cannot_create_writable_memory_vi, __pyx_k_Cannot_create_writable_memory_vi,
sizeof(__pyx_k_Cannot_create_writable_memory_vi), 0, 0, 1, 0},
22581 {&__pyx_kp_s_Cannot_index_with_type_s, __pyx_k_Cannot_index_with_type_s,
sizeof(__pyx_k_Cannot_index_with_type_s), 0, 0, 1, 0},
22582 {&__pyx_n_s_Context, __pyx_k_Context,
sizeof(__pyx_k_Context), 0, 0, 1, 1},
22583 {&__pyx_n_s_Domain, __pyx_k_Domain,
sizeof(__pyx_k_Domain), 0, 0, 1, 1},
22584 {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis,
sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1},
22585 {&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr,
sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0},
22586 {&__pyx_n_s_ImportError, __pyx_k_ImportError,
sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
22587 {&__pyx_kp_s_Incompatible_checksums_s_vs_0x96, __pyx_k_Incompatible_checksums_s_vs_0x96,
sizeof(__pyx_k_Incompatible_checksums_s_vs_0x96), 0, 0, 1, 0},
22588 {&__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_k_Incompatible_checksums_s_vs_0xb0,
sizeof(__pyx_k_Incompatible_checksums_s_vs_0xb0), 0, 0, 1, 0},
22589 {&__pyx_n_s_IndexError, __pyx_k_IndexError,
sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
22590 {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte,
sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0},
22591 {&__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_k_Invalid_mode_expected_c_or_fortr,
sizeof(__pyx_k_Invalid_mode_expected_c_or_fortr), 0, 0, 1, 0},
22592 {&__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_k_Invalid_shape_in_axis_d_d,
sizeof(__pyx_k_Invalid_shape_in_axis_d_d), 0, 0, 1, 0},
22593 {&__pyx_n_s_MemoryError, __pyx_k_MemoryError,
sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
22594 {&__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_k_MemoryView_of_r_at_0x_x,
sizeof(__pyx_k_MemoryView_of_r_at_0x_x), 0, 0, 1, 0},
22595 {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object,
sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0},
22596 {&__pyx_n_s_None, __pyx_k_None,
sizeof(__pyx_k_None), 0, 0, 1, 1},
22597 {&__pyx_n_b_O, __pyx_k_O,
sizeof(__pyx_k_O), 0, 0, 0, 1},
22598 {&__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_k_Out_of_bounds_on_buffer_access_a,
sizeof(__pyx_k_Out_of_bounds_on_buffer_access_a), 0, 0, 1, 0},
22599 {&__pyx_n_s_PickleError, __pyx_k_PickleError,
sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
22600 {&__pyx_kp_s_Shape_or_nd_must_be_passed_to_BC, __pyx_k_Shape_or_nd_must_be_passed_to_BC,
sizeof(__pyx_k_Shape_or_nd_must_be_passed_to_BC), 0, 0, 1, 0},
22601 {&__pyx_n_s_TypeError, __pyx_k_TypeError,
sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
22602 {&__pyx_kp_s_Unable_to_convert_item_to_object, __pyx_k_Unable_to_convert_item_to_object,
sizeof(__pyx_k_Unable_to_convert_item_to_object), 0, 0, 1, 0},
22603 {&__pyx_n_s_ValueError, __pyx_k_ValueError,
sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
22604 {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView,
sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1},
22605 {&__pyx_n_s_a, __pyx_k_a,
sizeof(__pyx_k_a), 0, 0, 1, 1},
22606 {&__pyx_n_s_a0, __pyx_k_a0,
sizeof(__pyx_k_a0), 0, 0, 1, 1},
22607 {&__pyx_n_s_all, __pyx_k_all,
sizeof(__pyx_k_all), 0, 0, 1, 1},
22608 {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer,
sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1},
22609 {&__pyx_n_s_b_i, __pyx_k_b_i,
sizeof(__pyx_k_b_i), 0, 0, 1, 1},
22610 {&__pyx_n_s_b_or, __pyx_k_b_or,
sizeof(__pyx_k_b_or), 0, 0, 1, 1},
22611 {&__pyx_n_s_base, __pyx_k_base,
sizeof(__pyx_k_base), 0, 0, 1, 1},
22612 {&__pyx_n_s_c, __pyx_k_c,
sizeof(__pyx_k_c), 0, 0, 1, 1},
22613 {&__pyx_n_u_c, __pyx_k_c,
sizeof(__pyx_k_c), 0, 1, 0, 1},
22614 {&__pyx_n_s_class, __pyx_k_class,
sizeof(__pyx_k_class), 0, 0, 1, 1},
22615 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback,
sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
22616 {&__pyx_n_s_context, __pyx_k_context,
sizeof(__pyx_k_context), 0, 0, 1, 1},
22617 {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct,
sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0},
22618 {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect,
sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0},
22619 {&__pyx_n_s_dict, __pyx_k_dict,
sizeof(__pyx_k_dict), 0, 0, 1, 1},
22620 {&__pyx_n_s_dict_2, __pyx_k_dict_2,
sizeof(__pyx_k_dict_2), 0, 0, 1, 1},
22621 {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object,
sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1},
22622 {&__pyx_n_s_encode, __pyx_k_encode,
sizeof(__pyx_k_encode), 0, 0, 1, 1},
22623 {&__pyx_n_s_enumerate, __pyx_k_enumerate,
sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
22624 {&__pyx_n_s_error, __pyx_k_error,
sizeof(__pyx_k_error), 0, 0, 1, 1},
22625 {&__pyx_n_s_flags, __pyx_k_flags,
sizeof(__pyx_k_flags), 0, 0, 1, 1},
22626 {&__pyx_n_s_format, __pyx_k_format,
sizeof(__pyx_k_format), 0, 0, 1, 1},
22627 {&__pyx_n_s_fortran, __pyx_k_fortran,
sizeof(__pyx_k_fortran), 0, 0, 1, 1},
22628 {&__pyx_n_u_fortran, __pyx_k_fortran,
sizeof(__pyx_k_fortran), 0, 1, 0, 1},
22629 {&__pyx_n_s_get, __pyx_k_get,
sizeof(__pyx_k_get), 0, 0, 1, 1},
22630 {&__pyx_n_s_getContext, __pyx_k_getContext,
sizeof(__pyx_k_getContext), 0, 0, 1, 1},
22631 {&__pyx_n_s_getstate, __pyx_k_getstate,
sizeof(__pyx_k_getstate), 0, 0, 1, 1},
22632 {&__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_k_got_differing_extents_in_dimensi,
sizeof(__pyx_k_got_differing_extents_in_dimensi), 0, 0, 1, 0},
22633 {&__pyx_n_s_id, __pyx_k_id,
sizeof(__pyx_k_id), 0, 0, 1, 1},
22634 {&__pyx_n_s_import, __pyx_k_import,
sizeof(__pyx_k_import), 0, 0, 1, 1},
22635 {&__pyx_n_s_init_cython, __pyx_k_init_cython,
sizeof(__pyx_k_init_cython), 0, 0, 1, 1},
22636 {&__pyx_n_s_itemsize, __pyx_k_itemsize,
sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
22637 {&__pyx_kp_s_itemsize_0_for_cython_array, __pyx_k_itemsize_0_for_cython_array,
sizeof(__pyx_k_itemsize_0_for_cython_array), 0, 0, 1, 0},
22638 {&__pyx_n_s_main, __pyx_k_main,
sizeof(__pyx_k_main), 0, 0, 1, 1},
22639 {&__pyx_n_s_memview, __pyx_k_memview,
sizeof(__pyx_k_memview), 0, 0, 1, 1},
22640 {&__pyx_n_s_mode, __pyx_k_mode,
sizeof(__pyx_k_mode), 0, 0, 1, 1},
22641 {&__pyx_n_s_n, __pyx_k_n,
sizeof(__pyx_k_n), 0, 0, 1, 1},
22642 {&__pyx_n_s_name, __pyx_k_name,
sizeof(__pyx_k_name), 0, 0, 1, 1},
22643 {&__pyx_n_s_name_2, __pyx_k_name_2,
sizeof(__pyx_k_name_2), 0, 0, 1, 1},
22644 {&__pyx_n_s_nd, __pyx_k_nd,
sizeof(__pyx_k_nd), 0, 0, 1, 1},
22645 {&__pyx_n_s_ndim, __pyx_k_ndim,
sizeof(__pyx_k_ndim), 0, 0, 1, 1},
22646 {&__pyx_n_s_new, __pyx_k_new,
sizeof(__pyx_k_new), 0, 0, 1, 1},
22647 {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non,
sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
22648 {&__pyx_n_s_np, __pyx_k_np,
sizeof(__pyx_k_np), 0, 0, 1, 1},
22649 {&__pyx_n_s_numpy, __pyx_k_numpy,
sizeof(__pyx_k_numpy), 0, 0, 1, 1},
22650 {&__pyx_kp_s_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to,
sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 0, 1, 0},
22651 {&__pyx_kp_s_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor,
sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 0, 1, 0},
22652 {&__pyx_n_s_obj, __pyx_k_obj,
sizeof(__pyx_k_obj), 0, 0, 1, 1},
22653 {&__pyx_n_s_pack, __pyx_k_pack,
sizeof(__pyx_k_pack), 0, 0, 1, 1},
22654 {&__pyx_n_s_pickle, __pyx_k_pickle,
sizeof(__pyx_k_pickle), 0, 0, 1, 1},
22655 {&__pyx_n_s_proteus, __pyx_k_proteus,
sizeof(__pyx_k_proteus), 0, 0, 1, 1},
22656 {&__pyx_kp_s_proteus_BoundaryConditions_py, __pyx_k_proteus_BoundaryConditions_py,
sizeof(__pyx_k_proteus_BoundaryConditions_py), 0, 0, 1, 0},
22657 {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError,
sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
22658 {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum,
sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
22659 {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer,
sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1},
22660 {&__pyx_n_s_pyx_result, __pyx_k_pyx_result,
sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
22661 {&__pyx_n_s_pyx_state, __pyx_k_pyx_state,
sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
22662 {&__pyx_n_s_pyx_type, __pyx_k_pyx_type,
sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
22663 {&__pyx_n_s_pyx_unpickle_BC_Base, __pyx_k_pyx_unpickle_BC_Base,
sizeof(__pyx_k_pyx_unpickle_BC_Base), 0, 0, 1, 1},
22664 {&__pyx_n_s_pyx_unpickle_Enum, __pyx_k_pyx_unpickle_Enum,
sizeof(__pyx_k_pyx_unpickle_Enum), 0, 0, 1, 1},
22665 {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable,
sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
22666 {&__pyx_n_s_range, __pyx_k_range,
sizeof(__pyx_k_range), 0, 0, 1, 1},
22667 {&__pyx_n_s_reduce, __pyx_k_reduce,
sizeof(__pyx_k_reduce), 0, 0, 1, 1},
22668 {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython,
sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
22669 {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex,
sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
22670 {&__pyx_n_s_resetBC, __pyx_k_resetBC,
sizeof(__pyx_k_resetBC), 0, 0, 1, 1},
22671 {&__pyx_n_s_self, __pyx_k_self,
sizeof(__pyx_k_self), 0, 0, 1, 1},
22672 {&__pyx_kp_s_self_uuOfXT_cannot_be_converted, __pyx_k_self_uuOfXT_cannot_be_converted,
sizeof(__pyx_k_self_uuOfXT_cannot_be_converted), 0, 0, 1, 0},
22673 {&__pyx_n_s_setConstantBC, __pyx_k_setConstantBC,
sizeof(__pyx_k_setConstantBC), 0, 0, 1, 1},
22674 {&__pyx_n_s_setConstantBC_locals_lambda, __pyx_k_setConstantBC_locals_lambda,
sizeof(__pyx_k_setConstantBC_locals_lambda), 0, 0, 1, 1},
22675 {&__pyx_n_s_setLinearBC, __pyx_k_setLinearBC,
sizeof(__pyx_k_setLinearBC), 0, 0, 1, 1},
22676 {&__pyx_n_s_setLinearBC_locals_lambda, __pyx_k_setLinearBC_locals_lambda,
sizeof(__pyx_k_setLinearBC_locals_lambda), 0, 0, 1, 1},
22677 {&__pyx_n_s_setLinearRamp, __pyx_k_setLinearRamp,
sizeof(__pyx_k_setLinearRamp), 0, 0, 1, 1},
22678 {&__pyx_n_s_setLinearRamp_locals_lambda, __pyx_k_setLinearRamp_locals_lambda,
sizeof(__pyx_k_setLinearRamp_locals_lambda), 0, 0, 1, 1},
22679 {&__pyx_n_s_setstate, __pyx_k_setstate,
sizeof(__pyx_k_setstate), 0, 0, 1, 1},
22680 {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython,
sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
22681 {&__pyx_n_s_shape, __pyx_k_shape,
sizeof(__pyx_k_shape), 0, 0, 1, 1},
22682 {&__pyx_n_s_size, __pyx_k_size,
sizeof(__pyx_k_size), 0, 0, 1, 1},
22683 {&__pyx_n_s_start, __pyx_k_start,
sizeof(__pyx_k_start), 0, 0, 1, 1},
22684 {&__pyx_n_s_state, __pyx_k_state,
sizeof(__pyx_k_state), 0, 0, 1, 1},
22685 {&__pyx_n_s_step, __pyx_k_step,
sizeof(__pyx_k_step), 0, 0, 1, 1},
22686 {&__pyx_n_s_stop, __pyx_k_stop,
sizeof(__pyx_k_stop), 0, 0, 1, 1},
22687 {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct,
sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0},
22688 {&__pyx_kp_s_strided_and_direct_or_indirect, __pyx_k_strided_and_direct_or_indirect,
sizeof(__pyx_k_strided_and_direct_or_indirect), 0, 0, 1, 0},
22689 {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect,
sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0},
22690 {&__pyx_kp_s_stringsource, __pyx_k_stringsource,
sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
22691 {&__pyx_n_s_struct, __pyx_k_struct,
sizeof(__pyx_k_struct), 0, 0, 1, 1},
22692 {&__pyx_n_s_sum, __pyx_k_sum,
sizeof(__pyx_k_sum), 0, 0, 1, 1},
22693 {&__pyx_n_s_t, __pyx_k_t,
sizeof(__pyx_k_t), 0, 0, 1, 1},
22694 {&__pyx_n_s_t1, __pyx_k_t1,
sizeof(__pyx_k_t1), 0, 0, 1, 1},
22695 {&__pyx_n_s_test, __pyx_k_test,
sizeof(__pyx_k_test), 0, 0, 1, 1},
22696 {&__pyx_kp_s_unable_to_allocate_array_data, __pyx_k_unable_to_allocate_array_data,
sizeof(__pyx_k_unable_to_allocate_array_data), 0, 0, 1, 0},
22697 {&__pyx_kp_s_unable_to_allocate_shape_and_str, __pyx_k_unable_to_allocate_shape_and_str,
sizeof(__pyx_k_unable_to_allocate_shape_and_str), 0, 0, 1, 0},
22698 {&__pyx_n_s_unpack, __pyx_k_unpack,
sizeof(__pyx_k_unpack), 0, 0, 1, 1},
22699 {&__pyx_n_s_update, __pyx_k_update,
sizeof(__pyx_k_update), 0, 0, 1, 1},
22700 {&__pyx_n_s_use_setstate, __pyx_k_use_setstate,
sizeof(__pyx_k_use_setstate), 0, 0, 1, 1},
22701 {&__pyx_n_s_value, __pyx_k_value,
sizeof(__pyx_k_value), 0, 0, 1, 1},
22702 {&__pyx_n_s_x, __pyx_k_x,
sizeof(__pyx_k_x), 0, 0, 1, 1},
22703 {&__pyx_n_s_zeros, __pyx_k_zeros,
sizeof(__pyx_k_zeros), 0, 0, 1, 1},
22704 {0, 0, 0, 0, 0, 0, 0}
22706 static CYTHON_SMALL_CODE
int __Pyx_InitCachedBuiltins(
void) {
22707 __pyx_builtin_sum = __Pyx_GetBuiltinName(__pyx_n_s_sum);
if (!__pyx_builtin_sum) __PYX_ERR(0, 113, __pyx_L1_error)
22708 __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError);
if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error)
22709 __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError);
if (!__pyx_builtin_ImportError) __PYX_ERR(3, 945, __pyx_L1_error)
22710 __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError);
if (!__pyx_builtin_ValueError) __PYX_ERR(1, 133, __pyx_L1_error)
22711 __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError);
if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 148, __pyx_L1_error)
22712 __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate);
if (!__pyx_builtin_enumerate) __PYX_ERR(1, 151, __pyx_L1_error)
22713 __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range);
if (!__pyx_builtin_range) __PYX_ERR(1, 180, __pyx_L1_error)
22714 __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis);
if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 404, __pyx_L1_error)
22715 __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id);
if (!__pyx_builtin_id) __PYX_ERR(1, 613, __pyx_L1_error)
22716 __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError);
if (!__pyx_builtin_IndexError) __PYX_ERR(1, 832, __pyx_L1_error)
22722 static CYTHON_SMALL_CODE
int __Pyx_InitCachedConstants(
void) {
22723 __Pyx_RefNannyDeclarations
22724 __Pyx_RefNannySetupContext(
"__Pyx_InitCachedConstants", 0);
22733 __pyx_slice__7 = PySlice_New(Py_None, Py_None, Py_None);
if (unlikely(!__pyx_slice__7)) __PYX_ERR(0, 113, __pyx_L1_error)
22734 __Pyx_GOTREF(__pyx_slice__7);
22735 __Pyx_GIVEREF(__pyx_slice__7);
22743 __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_self_uuOfXT_cannot_be_converted);
if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 2, __pyx_L1_error)
22744 __Pyx_GOTREF(__pyx_tuple__11);
22745 __Pyx_GIVEREF(__pyx_tuple__11);
22752 __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_self_uuOfXT_cannot_be_converted);
if (unlikely(!__pyx_tuple__13)) __PYX_ERR(1, 4, __pyx_L1_error)
22753 __Pyx_GOTREF(__pyx_tuple__13);
22754 __Pyx_GIVEREF(__pyx_tuple__13);
22763 __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to);
if (unlikely(!__pyx_tuple__15)) __PYX_ERR(3, 945, __pyx_L1_error)
22764 __Pyx_GOTREF(__pyx_tuple__15);
22765 __Pyx_GIVEREF(__pyx_tuple__15);
22774 __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor);
if (unlikely(!__pyx_tuple__16)) __PYX_ERR(3, 951, __pyx_L1_error)
22775 __Pyx_GOTREF(__pyx_tuple__16);
22776 __Pyx_GIVEREF(__pyx_tuple__16);
22785 __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr);
if (unlikely(!__pyx_tuple__17)) __PYX_ERR(1, 133, __pyx_L1_error)
22786 __Pyx_GOTREF(__pyx_tuple__17);
22787 __Pyx_GIVEREF(__pyx_tuple__17);
22796 __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array);
if (unlikely(!__pyx_tuple__18)) __PYX_ERR(1, 136, __pyx_L1_error)
22797 __Pyx_GOTREF(__pyx_tuple__18);
22798 __Pyx_GIVEREF(__pyx_tuple__18);
22807 __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str);
if (unlikely(!__pyx_tuple__19)) __PYX_ERR(1, 148, __pyx_L1_error)
22808 __Pyx_GOTREF(__pyx_tuple__19);
22809 __Pyx_GIVEREF(__pyx_tuple__19);
22818 __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data);
if (unlikely(!__pyx_tuple__20)) __PYX_ERR(1, 176, __pyx_L1_error)
22819 __Pyx_GOTREF(__pyx_tuple__20);
22820 __Pyx_GIVEREF(__pyx_tuple__20);
22829 __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is);
if (unlikely(!__pyx_tuple__21)) __PYX_ERR(1, 192, __pyx_L1_error)
22830 __Pyx_GOTREF(__pyx_tuple__21);
22831 __Pyx_GIVEREF(__pyx_tuple__21);
22839 __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__22)) __PYX_ERR(1, 2, __pyx_L1_error)
22840 __Pyx_GOTREF(__pyx_tuple__22);
22841 __Pyx_GIVEREF(__pyx_tuple__22);
22848 __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__23)) __PYX_ERR(1, 4, __pyx_L1_error)
22849 __Pyx_GOTREF(__pyx_tuple__23);
22850 __Pyx_GIVEREF(__pyx_tuple__23);
22859 __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor);
if (unlikely(!__pyx_tuple__24)) __PYX_ERR(1, 418, __pyx_L1_error)
22860 __Pyx_GOTREF(__pyx_tuple__24);
22861 __Pyx_GIVEREF(__pyx_tuple__24);
22870 __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object);
if (unlikely(!__pyx_tuple__25)) __PYX_ERR(1, 495, __pyx_L1_error)
22871 __Pyx_GOTREF(__pyx_tuple__25);
22872 __Pyx_GIVEREF(__pyx_tuple__25);
22881 __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi);
if (unlikely(!__pyx_tuple__26)) __PYX_ERR(1, 520, __pyx_L1_error)
22882 __Pyx_GOTREF(__pyx_tuple__26);
22883 __Pyx_GIVEREF(__pyx_tuple__26);
22892 __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri);
if (unlikely(!__pyx_tuple__27)) __PYX_ERR(1, 570, __pyx_L1_error)
22893 __Pyx_GOTREF(__pyx_tuple__27);
22894 __Pyx_GIVEREF(__pyx_tuple__27);
22903 __pyx_tuple__28 = PyTuple_New(1);
if (unlikely(!__pyx_tuple__28)) __PYX_ERR(1, 577, __pyx_L1_error)
22904 __Pyx_GOTREF(__pyx_tuple__28);
22905 __Pyx_INCREF(__pyx_int_neg_1);
22906 __Pyx_GIVEREF(__pyx_int_neg_1);
22907 PyTuple_SET_ITEM(__pyx_tuple__28, 0, __pyx_int_neg_1);
22908 __Pyx_GIVEREF(__pyx_tuple__28);
22916 __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__29)) __PYX_ERR(1, 2, __pyx_L1_error)
22917 __Pyx_GOTREF(__pyx_tuple__29);
22918 __Pyx_GIVEREF(__pyx_tuple__29);
22925 __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__30)) __PYX_ERR(1, 4, __pyx_L1_error)
22926 __Pyx_GOTREF(__pyx_tuple__30);
22927 __Pyx_GIVEREF(__pyx_tuple__30);
22936 __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte);
if (unlikely(!__pyx_tuple__31)) __PYX_ERR(1, 703, __pyx_L1_error)
22937 __Pyx_GOTREF(__pyx_tuple__31);
22938 __Pyx_GIVEREF(__pyx_tuple__31);
22946 __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__32)) __PYX_ERR(1, 2, __pyx_L1_error)
22947 __Pyx_GOTREF(__pyx_tuple__32);
22948 __Pyx_GIVEREF(__pyx_tuple__32);
22955 __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__33)) __PYX_ERR(1, 4, __pyx_L1_error)
22956 __Pyx_GOTREF(__pyx_tuple__33);
22957 __Pyx_GIVEREF(__pyx_tuple__33);
22966 __pyx_tuple__35 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_context, __pyx_n_s_Context);
if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 52, __pyx_L1_error)
22967 __Pyx_GOTREF(__pyx_tuple__35);
22968 __Pyx_GIVEREF(__pyx_tuple__35);
22969 __pyx_codeobj_ = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_BoundaryConditions_py, __pyx_n_s_getContext, 52, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj_)) __PYX_ERR(0, 52, __pyx_L1_error)
22976 __pyx_tuple__36 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_state, __pyx_n_s_dict_2, __pyx_n_s_use_setstate);
if (unlikely(!__pyx_tuple__36)) __PYX_ERR(1, 1, __pyx_L1_error)
22977 __Pyx_GOTREF(__pyx_tuple__36);
22978 __Pyx_GIVEREF(__pyx_tuple__36);
22979 __pyx_codeobj__2 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__2)) __PYX_ERR(1, 1, __pyx_L1_error)
22987 __pyx_tuple__37 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state);
if (unlikely(!__pyx_tuple__37)) __PYX_ERR(1, 16, __pyx_L1_error)
22988 __Pyx_GOTREF(__pyx_tuple__37);
22989 __Pyx_GIVEREF(__pyx_tuple__37);
22990 __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 16, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(1, 16, __pyx_L1_error)
22999 __pyx_tuple__38 = PyTuple_Pack(1, __pyx_n_s_self);
if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 81, __pyx_L1_error)
23000 __Pyx_GOTREF(__pyx_tuple__38);
23001 __Pyx_GIVEREF(__pyx_tuple__38);
23002 __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_BoundaryConditions_py, __pyx_n_s_init_cython, 81, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 81, __pyx_L1_error)
23011 __pyx_tuple__39 = PyTuple_Pack(1, __pyx_n_s_self);
if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 84, __pyx_L1_error)
23012 __Pyx_GOTREF(__pyx_tuple__39);
23013 __Pyx_GIVEREF(__pyx_tuple__39);
23014 __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_BoundaryConditions_py, __pyx_n_s_resetBC, 84, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(0, 84, __pyx_L1_error)
23023 __pyx_tuple__40 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_value);
if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 87, __pyx_L1_error)
23024 __Pyx_GOTREF(__pyx_tuple__40);
23025 __Pyx_GIVEREF(__pyx_tuple__40);
23026 __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_BoundaryConditions_py, __pyx_n_s_setConstantBC, 87, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 87, __pyx_L1_error)
23035 __pyx_tuple__41 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_a0, __pyx_n_s_a);
if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 100, __pyx_L1_error)
23036 __Pyx_GOTREF(__pyx_tuple__41);
23037 __Pyx_GIVEREF(__pyx_tuple__41);
23038 __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_BoundaryConditions_py, __pyx_n_s_setLinearBC, 100, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 100, __pyx_L1_error)
23047 __pyx_tuple__42 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_t1, __pyx_n_s_value);
if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 115, __pyx_L1_error)
23048 __Pyx_GOTREF(__pyx_tuple__42);
23049 __Pyx_GIVEREF(__pyx_tuple__42);
23050 __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_BoundaryConditions_py, __pyx_n_s_setLinearRamp, 115, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 115, __pyx_L1_error)
23057 __pyx_tuple__43 = PyTuple_Pack(1, __pyx_n_s_self);
if (unlikely(!__pyx_tuple__43)) __PYX_ERR(1, 1, __pyx_L1_error)
23058 __Pyx_GOTREF(__pyx_tuple__43);
23059 __Pyx_GIVEREF(__pyx_tuple__43);
23060 __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(1, 1, __pyx_L1_error)
23068 __pyx_tuple__44 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state);
if (unlikely(!__pyx_tuple__44)) __PYX_ERR(1, 3, __pyx_L1_error)
23069 __Pyx_GOTREF(__pyx_tuple__44);
23070 __Pyx_GIVEREF(__pyx_tuple__44);
23071 __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__44, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(1, 3, __pyx_L1_error)
23078 __pyx_tuple__45 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result);
if (unlikely(!__pyx_tuple__45)) __PYX_ERR(1, 1, __pyx_L1_error)
23079 __Pyx_GOTREF(__pyx_tuple__45);
23080 __Pyx_GIVEREF(__pyx_tuple__45);
23081 __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_BC_Base, 1, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(1, 1, __pyx_L1_error)
23090 __pyx_tuple__46 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect);
if (unlikely(!__pyx_tuple__46)) __PYX_ERR(1, 286, __pyx_L1_error)
23091 __Pyx_GOTREF(__pyx_tuple__46);
23092 __Pyx_GIVEREF(__pyx_tuple__46);
23101 __pyx_tuple__47 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct);
if (unlikely(!__pyx_tuple__47)) __PYX_ERR(1, 287, __pyx_L1_error)
23102 __Pyx_GOTREF(__pyx_tuple__47);
23103 __Pyx_GIVEREF(__pyx_tuple__47);
23112 __pyx_tuple__48 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect);
if (unlikely(!__pyx_tuple__48)) __PYX_ERR(1, 288, __pyx_L1_error)
23113 __Pyx_GOTREF(__pyx_tuple__48);
23114 __Pyx_GIVEREF(__pyx_tuple__48);
23123 __pyx_tuple__49 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct);
if (unlikely(!__pyx_tuple__49)) __PYX_ERR(1, 291, __pyx_L1_error)
23124 __Pyx_GOTREF(__pyx_tuple__49);
23125 __Pyx_GIVEREF(__pyx_tuple__49);
23134 __pyx_tuple__50 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect);
if (unlikely(!__pyx_tuple__50)) __PYX_ERR(1, 292, __pyx_L1_error)
23135 __Pyx_GOTREF(__pyx_tuple__50);
23136 __Pyx_GIVEREF(__pyx_tuple__50);
23143 __pyx_tuple__51 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result);
if (unlikely(!__pyx_tuple__51)) __PYX_ERR(1, 1, __pyx_L1_error)
23144 __Pyx_GOTREF(__pyx_tuple__51);
23145 __Pyx_GIVEREF(__pyx_tuple__51);
23146 __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(1, 1, __pyx_L1_error)
23147 __Pyx_RefNannyFinishContext();
23150 __Pyx_RefNannyFinishContext();
23154 static CYTHON_SMALL_CODE
int __Pyx_InitGlobals(
void) {
23155 if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
23156 __pyx_int_0 = PyInt_FromLong(0);
if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
23157 __pyx_int_1 = PyInt_FromLong(1);
if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
23158 __pyx_int_3 = PyInt_FromLong(3);
if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error)
23159 __pyx_int_158231071 = PyInt_FromLong(158231071
L);
if (unlikely(!__pyx_int_158231071)) __PYX_ERR(0, 1, __pyx_L1_error)
23160 __pyx_int_184977713 = PyInt_FromLong(184977713
L);
if (unlikely(!__pyx_int_184977713)) __PYX_ERR(0, 1, __pyx_L1_error)
23161 __pyx_int_neg_1 = PyInt_FromLong(-1);
if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
23167 static CYTHON_SMALL_CODE
int __Pyx_modinit_global_init_code(
void);
23168 static CYTHON_SMALL_CODE
int __Pyx_modinit_variable_export_code(
void);
23169 static CYTHON_SMALL_CODE
int __Pyx_modinit_function_export_code(
void);
23170 static CYTHON_SMALL_CODE
int __Pyx_modinit_type_init_code(
void);
23171 static CYTHON_SMALL_CODE
int __Pyx_modinit_type_import_code(
void);
23172 static CYTHON_SMALL_CODE
int __Pyx_modinit_variable_import_code(
void);
23173 static CYTHON_SMALL_CODE
int __Pyx_modinit_function_import_code(
void);
23175 static int __Pyx_modinit_global_init_code(
void) {
23176 __Pyx_RefNannyDeclarations
23177 __Pyx_RefNannySetupContext(
"__Pyx_modinit_global_init_code", 0);
23179 generic = Py_None; Py_INCREF(Py_None);
23180 strided = Py_None; Py_INCREF(Py_None);
23181 indirect = Py_None; Py_INCREF(Py_None);
23182 contiguous = Py_None; Py_INCREF(Py_None);
23183 indirect_contiguous = Py_None; Py_INCREF(Py_None);
23184 __Pyx_RefNannyFinishContext();
23188 static int __Pyx_modinit_variable_export_code(
void) {
23189 __Pyx_RefNannyDeclarations
23190 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_export_code", 0);
23192 __Pyx_RefNannyFinishContext();
23196 static int __Pyx_modinit_function_export_code(
void) {
23197 __Pyx_RefNannyDeclarations
23198 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_export_code", 0);
23200 __Pyx_RefNannyFinishContext();
23204 static int __Pyx_modinit_type_init_code(
void) {
23205 __Pyx_RefNannyDeclarations
23206 int __pyx_lineno = 0;
23207 const char *__pyx_filename = NULL;
23208 int __pyx_clineno = 0;
23209 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_init_code", 0);
23211 if (PyType_Ready(&__pyx_type_18BoundaryConditions_BC_Base) < 0) __PYX_ERR(0, 20, __pyx_L1_error)
23212 #if PY_VERSION_HEX < 0x030800B1
23213 __pyx_type_18BoundaryConditions_BC_Base.tp_print = 0;
23215 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_18BoundaryConditions_BC_Base.tp_dictoffset && __pyx_type_18BoundaryConditions_BC_Base.tp_getattro == PyObject_GenericGetAttr)) {
23216 __pyx_type_18BoundaryConditions_BC_Base.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23218 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BC_Base, (PyObject *)&__pyx_type_18BoundaryConditions_BC_Base) < 0) __PYX_ERR(0, 20, __pyx_L1_error)
23219 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_18BoundaryConditions_BC_Base) < 0) __PYX_ERR(0, 20, __pyx_L1_error)
23220 __pyx_ptype_18BoundaryConditions_BC_Base = &__pyx_type_18BoundaryConditions_BC_Base;
23221 __pyx_vtabptr_18BoundaryConditions_BoundaryCondition = &__pyx_vtable_18BoundaryConditions_BoundaryCondition;
23222 __pyx_vtable_18BoundaryConditions_BoundaryCondition.resetBC = (void (*)(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *,
int __pyx_skip_dispatch))__pyx_f_18BoundaryConditions_17BoundaryCondition_resetBC;
23223 if (PyType_Ready(&__pyx_type_18BoundaryConditions_BoundaryCondition) < 0) __PYX_ERR(0, 68, __pyx_L1_error)
23224 #if PY_VERSION_HEX < 0x030800B1
23225 __pyx_type_18BoundaryConditions_BoundaryCondition.tp_print = 0;
23227 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_18BoundaryConditions_BoundaryCondition.tp_dictoffset && __pyx_type_18BoundaryConditions_BoundaryCondition.tp_getattro == PyObject_GenericGetAttr)) {
23228 __pyx_type_18BoundaryConditions_BoundaryCondition.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23230 if (__Pyx_SetVtable(__pyx_type_18BoundaryConditions_BoundaryCondition.tp_dict, __pyx_vtabptr_18BoundaryConditions_BoundaryCondition) < 0) __PYX_ERR(0, 68, __pyx_L1_error)
23231 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BoundaryCondition, (PyObject *)&__pyx_type_18BoundaryConditions_BoundaryCondition) < 0) __PYX_ERR(0, 68, __pyx_L1_error)
23232 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_18BoundaryConditions_BoundaryCondition) < 0) __PYX_ERR(0, 68, __pyx_L1_error)
23233 __pyx_ptype_18BoundaryConditions_BoundaryCondition = &__pyx_type_18BoundaryConditions_BoundaryCondition;
23234 if (PyType_Ready(&__pyx_type_18BoundaryConditions___pyx_scope_struct__setConstantBC) < 0) __PYX_ERR(0, 87, __pyx_L1_error)
23235 #if PY_VERSION_HEX < 0x030800B1
23236 __pyx_type_18BoundaryConditions___pyx_scope_struct__setConstantBC.tp_print = 0;
23238 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_18BoundaryConditions___pyx_scope_struct__setConstantBC.tp_dictoffset && __pyx_type_18BoundaryConditions___pyx_scope_struct__setConstantBC.tp_getattro == PyObject_GenericGetAttr)) {
23239 __pyx_type_18BoundaryConditions___pyx_scope_struct__setConstantBC.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
23241 __pyx_ptype_18BoundaryConditions___pyx_scope_struct__setConstantBC = &__pyx_type_18BoundaryConditions___pyx_scope_struct__setConstantBC;
23242 if (PyType_Ready(&__pyx_type_18BoundaryConditions___pyx_scope_struct_1_setLinearBC) < 0) __PYX_ERR(0, 100, __pyx_L1_error)
23243 #if PY_VERSION_HEX < 0x030800B1
23244 __pyx_type_18BoundaryConditions___pyx_scope_struct_1_setLinearBC.tp_print = 0;
23246 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_18BoundaryConditions___pyx_scope_struct_1_setLinearBC.tp_dictoffset && __pyx_type_18BoundaryConditions___pyx_scope_struct_1_setLinearBC.tp_getattro == PyObject_GenericGetAttr)) {
23247 __pyx_type_18BoundaryConditions___pyx_scope_struct_1_setLinearBC.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
23249 __pyx_ptype_18BoundaryConditions___pyx_scope_struct_1_setLinearBC = &__pyx_type_18BoundaryConditions___pyx_scope_struct_1_setLinearBC;
23250 if (PyType_Ready(&__pyx_type_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp) < 0) __PYX_ERR(0, 115, __pyx_L1_error)
23251 #if PY_VERSION_HEX < 0x030800B1
23252 __pyx_type_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp.tp_print = 0;
23254 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp.tp_dictoffset && __pyx_type_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp.tp_getattro == PyObject_GenericGetAttr)) {
23255 __pyx_type_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
23257 __pyx_ptype_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp = &__pyx_type_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp;
23258 __pyx_vtabptr_array = &__pyx_vtable_array;
23259 __pyx_vtable_array.get_memview = (PyObject *(*)(
struct __pyx_array_obj *))__pyx_array_get_memview;
23260 if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
23261 #if PY_VERSION_HEX < 0x030800B1
23262 __pyx_type___pyx_array.tp_print = 0;
23264 if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
23265 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
23266 __pyx_array_type = &__pyx_type___pyx_array;
23267 if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 279, __pyx_L1_error)
23268 #if PY_VERSION_HEX < 0x030800B1
23269 __pyx_type___pyx_MemviewEnum.tp_print = 0;
23271 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_MemviewEnum.tp_dictoffset && __pyx_type___pyx_MemviewEnum.tp_getattro == PyObject_GenericGetAttr)) {
23272 __pyx_type___pyx_MemviewEnum.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23274 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 279, __pyx_L1_error)
23275 __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
23276 __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
23277 __pyx_vtable_memoryview.get_item_pointer = (
char *(*)(
struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
23278 __pyx_vtable_memoryview.is_slice = (PyObject *(*)(
struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
23279 __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
23280 __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(
struct __pyx_memoryview_obj *,
struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
23281 __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
23282 __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *))__pyx_memoryview_convert_item_to_object;
23283 __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *, PyObject *))__pyx_memoryview_assign_item_from_object;
23284 if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
23285 #if PY_VERSION_HEX < 0x030800B1
23286 __pyx_type___pyx_memoryview.tp_print = 0;
23288 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryview.tp_dictoffset && __pyx_type___pyx_memoryview.tp_getattro == PyObject_GenericGetAttr)) {
23289 __pyx_type___pyx_memoryview.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23291 if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
23292 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
23293 __pyx_memoryview_type = &__pyx_type___pyx_memoryview;
23294 __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
23295 __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
23296 __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *))__pyx_memoryviewslice_convert_item_to_object;
23297 __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
23298 __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type;
23299 if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 965, __pyx_L1_error)
23300 #if PY_VERSION_HEX < 0x030800B1
23301 __pyx_type___pyx_memoryviewslice.tp_print = 0;
23303 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryviewslice.tp_dictoffset && __pyx_type___pyx_memoryviewslice.tp_getattro == PyObject_GenericGetAttr)) {
23304 __pyx_type___pyx_memoryviewslice.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23306 if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(1, 965, __pyx_L1_error)
23307 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 965, __pyx_L1_error)
23308 __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
23309 __Pyx_RefNannyFinishContext();
23312 __Pyx_RefNannyFinishContext();
23316 static int __Pyx_modinit_type_import_code(
void) {
23317 __Pyx_RefNannyDeclarations
23318 PyObject *__pyx_t_1 = NULL;
23319 int __pyx_lineno = 0;
23320 const char *__pyx_filename = NULL;
23321 int __pyx_clineno = 0;
23322 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_import_code", 0);
23324 __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 9, __pyx_L1_error)
23325 __Pyx_GOTREF(__pyx_t_1);
23326 __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME,
"type",
23327 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
23328 sizeof(PyTypeObject),
23330 sizeof(PyHeapTypeObject),
23332 __Pyx_ImportType_CheckSize_Warn);
23333 if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(4, 9, __pyx_L1_error)
23334 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23335 __pyx_t_1 = PyImport_ImportModule(
"numpy");
if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 200, __pyx_L1_error)
23336 __Pyx_GOTREF(__pyx_t_1);
23337 __pyx_ptype_5numpy_dtype = __Pyx_ImportType(__pyx_t_1,
"numpy",
"dtype",
sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Ignore);
23338 if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(3, 200, __pyx_L1_error)
23339 __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(__pyx_t_1,
"numpy",
"flatiter",
sizeof(PyArrayIterObject), __Pyx_ImportType_CheckSize_Ignore);
23340 if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(3, 223, __pyx_L1_error)
23341 __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(__pyx_t_1,
"numpy",
"broadcast",
sizeof(PyArrayMultiIterObject), __Pyx_ImportType_CheckSize_Ignore);
23342 if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(3, 227, __pyx_L1_error)
23343 __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(__pyx_t_1,
"numpy",
"ndarray",
sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Ignore);
23344 if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(3, 239, __pyx_L1_error)
23345 __pyx_ptype_5numpy_generic = __Pyx_ImportType(__pyx_t_1,
"numpy",
"generic",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
23346 if (!__pyx_ptype_5numpy_generic) __PYX_ERR(3, 771, __pyx_L1_error)
23347 __pyx_ptype_5numpy_number = __Pyx_ImportType(__pyx_t_1,
"numpy",
"number",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
23348 if (!__pyx_ptype_5numpy_number) __PYX_ERR(3, 773, __pyx_L1_error)
23349 __pyx_ptype_5numpy_integer = __Pyx_ImportType(__pyx_t_1,
"numpy",
"integer",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
23350 if (!__pyx_ptype_5numpy_integer) __PYX_ERR(3, 775, __pyx_L1_error)
23351 __pyx_ptype_5numpy_signedinteger = __Pyx_ImportType(__pyx_t_1,
"numpy",
"signedinteger",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
23352 if (!__pyx_ptype_5numpy_signedinteger) __PYX_ERR(3, 777, __pyx_L1_error)
23353 __pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType(__pyx_t_1,
"numpy",
"unsignedinteger",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
23354 if (!__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(3, 779, __pyx_L1_error)
23355 __pyx_ptype_5numpy_inexact = __Pyx_ImportType(__pyx_t_1,
"numpy",
"inexact",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
23356 if (!__pyx_ptype_5numpy_inexact) __PYX_ERR(3, 781, __pyx_L1_error)
23357 __pyx_ptype_5numpy_floating = __Pyx_ImportType(__pyx_t_1,
"numpy",
"floating",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
23358 if (!__pyx_ptype_5numpy_floating) __PYX_ERR(3, 783, __pyx_L1_error)
23359 __pyx_ptype_5numpy_complexfloating = __Pyx_ImportType(__pyx_t_1,
"numpy",
"complexfloating",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
23360 if (!__pyx_ptype_5numpy_complexfloating) __PYX_ERR(3, 785, __pyx_L1_error)
23361 __pyx_ptype_5numpy_flexible = __Pyx_ImportType(__pyx_t_1,
"numpy",
"flexible",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
23362 if (!__pyx_ptype_5numpy_flexible) __PYX_ERR(3, 787, __pyx_L1_error)
23363 __pyx_ptype_5numpy_character = __Pyx_ImportType(__pyx_t_1,
"numpy",
"character",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
23364 if (!__pyx_ptype_5numpy_character) __PYX_ERR(3, 789, __pyx_L1_error)
23365 __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(__pyx_t_1,
"numpy",
"ufunc",
sizeof(PyUFuncObject), __Pyx_ImportType_CheckSize_Ignore);
23366 if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(3, 827, __pyx_L1_error)
23367 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23368 __Pyx_RefNannyFinishContext();
23371 __Pyx_XDECREF(__pyx_t_1);
23372 __Pyx_RefNannyFinishContext();
23376 static int __Pyx_modinit_variable_import_code(
void) {
23377 __Pyx_RefNannyDeclarations
23378 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_import_code", 0);
23380 __Pyx_RefNannyFinishContext();
23384 static int __Pyx_modinit_function_import_code(
void) {
23385 __Pyx_RefNannyDeclarations
23386 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_import_code", 0);
23388 __Pyx_RefNannyFinishContext();
23393 #ifndef CYTHON_NO_PYINIT_EXPORT
23394 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
23395 #elif PY_MAJOR_VERSION < 3
23397 #define __Pyx_PyMODINIT_FUNC extern "C" void
23399 #define __Pyx_PyMODINIT_FUNC void
23403 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
23405 #define __Pyx_PyMODINIT_FUNC PyObject *
23410 #if PY_MAJOR_VERSION < 3
23411 __Pyx_PyMODINIT_FUNC initBoundaryConditions(
void) CYTHON_SMALL_CODE;
23412 __Pyx_PyMODINIT_FUNC initBoundaryConditions(
void)
23414 __Pyx_PyMODINIT_FUNC PyInit_BoundaryConditions(
void) CYTHON_SMALL_CODE;
23415 __Pyx_PyMODINIT_FUNC PyInit_BoundaryConditions(
void)
23416 #if CYTHON_PEP489_MULTI_PHASE_INIT
23418 return PyModuleDef_Init(&__pyx_moduledef);
23420 static CYTHON_SMALL_CODE
int __Pyx_check_single_interpreter(
void) {
23421 #if PY_VERSION_HEX >= 0x030700A1
23422 static PY_INT64_T main_interpreter_id = -1;
23423 PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
23424 if (main_interpreter_id == -1) {
23425 main_interpreter_id = current_id;
23426 return (unlikely(current_id == -1)) ? -1 : 0;
23427 }
else if (unlikely(main_interpreter_id != current_id))
23429 static PyInterpreterState *main_interpreter = NULL;
23430 PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
23431 if (!main_interpreter) {
23432 main_interpreter = current_interpreter;
23433 }
else if (unlikely(main_interpreter != current_interpreter))
23438 "Interpreter change detected - this module can only be loaded into one interpreter per process.");
23443 static CYTHON_SMALL_CODE
int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict,
const char* from_name,
const char* to_name,
int allow_none) {
23444 PyObject *value = PyObject_GetAttrString(spec, from_name);
23446 if (likely(value)) {
23447 if (allow_none || value != Py_None) {
23448 result = PyDict_SetItemString(moddict, to_name, value);
23451 }
else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
23458 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
23459 PyObject *module = NULL, *moddict, *modname;
23460 if (__Pyx_check_single_interpreter())
23463 return __Pyx_NewRef(__pyx_m);
23464 modname = PyObject_GetAttrString(spec,
"name");
23465 if (unlikely(!modname))
goto bad;
23466 module = PyModule_NewObject(modname);
23467 Py_DECREF(modname);
23468 if (unlikely(!module))
goto bad;
23469 moddict = PyModule_GetDict(module);
23470 if (unlikely(!moddict))
goto bad;
23471 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"loader",
"__loader__", 1) < 0))
goto bad;
23472 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"origin",
"__file__", 1) < 0))
goto bad;
23473 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"parent",
"__package__", 1) < 0))
goto bad;
23474 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"submodule_search_locations",
"__path__", 0) < 0))
goto bad;
23477 Py_XDECREF(module);
23482 static CYTHON_SMALL_CODE
int __pyx_pymod_exec_BoundaryConditions(PyObject *__pyx_pyinit_module)
23486 __Pyx_TraceDeclarations
23487 PyObject *__pyx_t_1 = NULL;
23488 static PyThread_type_lock __pyx_t_2[8];
23489 int __pyx_lineno = 0;
23490 const char *__pyx_filename = NULL;
23491 int __pyx_clineno = 0;
23492 __Pyx_RefNannyDeclarations
23493 #if CYTHON_PEP489_MULTI_PHASE_INIT
23495 if (__pyx_m == __pyx_pyinit_module)
return 0;
23496 PyErr_SetString(PyExc_RuntimeError,
"Module 'BoundaryConditions' has already been imported. Re-initialisation is not supported.");
23499 #elif PY_MAJOR_VERSION >= 3
23500 if (__pyx_m)
return __Pyx_NewRef(__pyx_m);
23502 #if CYTHON_REFNANNY
23503 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"refnanny");
23504 if (!__Pyx_RefNanny) {
23506 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"Cython.Runtime.refnanny");
23507 if (!__Pyx_RefNanny)
23508 Py_FatalError(
"failed to import 'refnanny' module");
23511 __Pyx_RefNannySetupContext(
"__Pyx_PyMODINIT_FUNC PyInit_BoundaryConditions(void)", 0);
23512 if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23513 #ifdef __Pxy_PyFrame_Initialize_Offsets
23514 __Pxy_PyFrame_Initialize_Offsets();
23516 __pyx_empty_tuple = PyTuple_New(0);
if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
23517 __pyx_empty_bytes = PyBytes_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
23518 __pyx_empty_unicode = PyUnicode_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
23519 #ifdef __Pyx_CyFunction_USED
23520 if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23522 #ifdef __Pyx_FusedFunction_USED
23523 if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23525 #ifdef __Pyx_Coroutine_USED
23526 if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23528 #ifdef __Pyx_Generator_USED
23529 if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23531 #ifdef __Pyx_AsyncGen_USED
23532 if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23534 #ifdef __Pyx_StopAsyncIteration_USED
23535 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23539 #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
23540 PyEval_InitThreads();
23543 #if CYTHON_PEP489_MULTI_PHASE_INIT
23544 __pyx_m = __pyx_pyinit_module;
23545 Py_INCREF(__pyx_m);
23547 #if PY_MAJOR_VERSION < 3
23548 __pyx_m = Py_InitModule4(
"BoundaryConditions", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
23550 __pyx_m = PyModule_Create(&__pyx_moduledef);
23552 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
23554 __pyx_d = PyModule_GetDict(__pyx_m);
if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
23555 Py_INCREF(__pyx_d);
23556 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
23557 Py_INCREF(__pyx_b);
23558 __pyx_cython_runtime = PyImport_AddModule((
char *)
"cython_runtime");
if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
23559 Py_INCREF(__pyx_cython_runtime);
23560 if (PyObject_SetAttrString(__pyx_m,
"__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
23562 if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23563 #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
23564 if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23566 if (__pyx_module_is_main_BoundaryConditions) {
23567 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23569 #if PY_MAJOR_VERSION >= 3
23571 PyObject *modules = PyImport_GetModuleDict();
if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
23572 if (!PyDict_GetItemString(modules,
"BoundaryConditions")) {
23573 if (unlikely(PyDict_SetItemString(modules,
"BoundaryConditions", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
23578 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23580 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23582 (void)__Pyx_modinit_global_init_code();
23583 (void)__Pyx_modinit_variable_export_code();
23584 (void)__Pyx_modinit_function_export_code();
23585 if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
23586 if (unlikely(__Pyx_modinit_type_import_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
23587 (void)__Pyx_modinit_variable_import_code();
23588 (void)__Pyx_modinit_function_import_code();
23590 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
23591 if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23593 __Pyx_TraceCall(
"__Pyx_PyMODINIT_FUNC PyInit_BoundaryConditions(void)", __pyx_f[0], 1, 0, __PYX_ERR(0, 1, __pyx_L1_error));
23602 __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error)
23603 __Pyx_GOTREF(__pyx_t_1);
23604 if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 9, __pyx_L1_error)
23605 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23614 __pyx_t_1 = PyList_New(2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error)
23615 __Pyx_GOTREF(__pyx_t_1);
23616 __Pyx_INCREF(__pyx_n_s_BC_Base);
23617 __Pyx_GIVEREF(__pyx_n_s_BC_Base);
23618 PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_BC_Base);
23619 __Pyx_INCREF(__pyx_n_s_BoundaryCondition);
23620 __Pyx_GIVEREF(__pyx_n_s_BoundaryCondition);
23621 PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_BoundaryCondition);
23622 if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_1) < 0) __PYX_ERR(0, 17, __pyx_L1_error)
23623 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23632 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_18BoundaryConditions_7BC_Base_3getContext, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BC_Base_getContext, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj_));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 52, __pyx_L1_error)
23633 __Pyx_GOTREF(__pyx_t_1);
23634 if (PyDict_SetItem((PyObject *)__pyx_ptype_18BoundaryConditions_BC_Base->tp_dict, __pyx_n_s_getContext, __pyx_t_1) < 0) __PYX_ERR(0, 52, __pyx_L1_error)
23635 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23636 PyType_Modified(__pyx_ptype_18BoundaryConditions_BC_Base);
23643 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_18BoundaryConditions_7BC_Base_5__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BC_Base___reduce_cython, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__2));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
23644 __Pyx_GOTREF(__pyx_t_1);
23645 if (PyDict_SetItem((PyObject *)__pyx_ptype_18BoundaryConditions_BC_Base->tp_dict, __pyx_n_s_reduce_cython, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
23646 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23647 PyType_Modified(__pyx_ptype_18BoundaryConditions_BC_Base);
23655 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_18BoundaryConditions_7BC_Base_7__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BC_Base___setstate_cython, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__3));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 16, __pyx_L1_error)
23656 __Pyx_GOTREF(__pyx_t_1);
23657 if (PyDict_SetItem((PyObject *)__pyx_ptype_18BoundaryConditions_BC_Base->tp_dict, __pyx_n_s_setstate_cython, __pyx_t_1) < 0) __PYX_ERR(1, 16, __pyx_L1_error)
23658 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23659 PyType_Modified(__pyx_ptype_18BoundaryConditions_BC_Base);
23668 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_3init_cython, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoundaryCondition_init_cython, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__4));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 81, __pyx_L1_error)
23669 __Pyx_GOTREF(__pyx_t_1);
23670 if (PyDict_SetItem((PyObject *)__pyx_ptype_18BoundaryConditions_BoundaryCondition->tp_dict, __pyx_n_s_init_cython, __pyx_t_1) < 0) __PYX_ERR(0, 81, __pyx_L1_error)
23671 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23672 PyType_Modified(__pyx_ptype_18BoundaryConditions_BoundaryCondition);
23681 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_5resetBC, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoundaryCondition_resetBC, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__5));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error)
23682 __Pyx_GOTREF(__pyx_t_1);
23683 if (PyDict_SetItem((PyObject *)__pyx_ptype_18BoundaryConditions_BoundaryCondition->tp_dict, __pyx_n_s_resetBC, __pyx_t_1) < 0) __PYX_ERR(0, 84, __pyx_L1_error)
23684 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23685 PyType_Modified(__pyx_ptype_18BoundaryConditions_BoundaryCondition);
23694 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_7setConstantBC, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoundaryCondition_setConstantBC, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__6));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error)
23695 __Pyx_GOTREF(__pyx_t_1);
23696 if (PyDict_SetItem((PyObject *)__pyx_ptype_18BoundaryConditions_BoundaryCondition->tp_dict, __pyx_n_s_setConstantBC, __pyx_t_1) < 0) __PYX_ERR(0, 87, __pyx_L1_error)
23697 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23698 PyType_Modified(__pyx_ptype_18BoundaryConditions_BoundaryCondition);
23707 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_9setLinearBC, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoundaryCondition_setLinearBC, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__8));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 100, __pyx_L1_error)
23708 __Pyx_GOTREF(__pyx_t_1);
23709 if (PyDict_SetItem((PyObject *)__pyx_ptype_18BoundaryConditions_BoundaryCondition->tp_dict, __pyx_n_s_setLinearBC, __pyx_t_1) < 0) __PYX_ERR(0, 100, __pyx_L1_error)
23710 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23711 PyType_Modified(__pyx_ptype_18BoundaryConditions_BoundaryCondition);
23720 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_11setLinearRamp, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoundaryCondition_setLinearRamp, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__9));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 115, __pyx_L1_error)
23721 __Pyx_GOTREF(__pyx_t_1);
23722 if (PyDict_SetItem((PyObject *)__pyx_ptype_18BoundaryConditions_BoundaryCondition->tp_dict, __pyx_n_s_setLinearRamp, __pyx_t_1) < 0) __PYX_ERR(0, 115, __pyx_L1_error)
23723 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23724 PyType_Modified(__pyx_ptype_18BoundaryConditions_BoundaryCondition);
23731 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_13__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoundaryCondition___reduce_cytho, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__10));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
23732 __Pyx_GOTREF(__pyx_t_1);
23733 if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
23734 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23742 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_15__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoundaryCondition___setstate_cyt, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__12));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3, __pyx_L1_error)
23743 __Pyx_GOTREF(__pyx_t_1);
23744 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_1) < 0) __PYX_ERR(1, 3, __pyx_L1_error)
23745 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23752 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_18BoundaryConditions_1__pyx_unpickle_BC_Base, 0, __pyx_n_s_pyx_unpickle_BC_Base, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__14));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
23753 __Pyx_GOTREF(__pyx_t_1);
23754 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_BC_Base, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
23755 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23762 __pyx_t_1 = __Pyx_PyDict_NewPresized(0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
23763 __Pyx_GOTREF(__pyx_t_1);
23764 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23765 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23774 __pyx_t_1 = __pyx_capsule_create(((
void *)(&__pyx_array_getbuffer)), ((
char *)
"getbuffer(obj, view, flags)"));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 209, __pyx_L1_error)
23775 __Pyx_GOTREF(__pyx_t_1);
23776 if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 209, __pyx_L1_error)
23777 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23778 PyType_Modified(__pyx_array_type);
23787 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__46, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 286, __pyx_L1_error)
23788 __Pyx_GOTREF(__pyx_t_1);
23789 __Pyx_XGOTREF(
generic);
23790 __Pyx_DECREF_SET(
generic, __pyx_t_1);
23791 __Pyx_GIVEREF(__pyx_t_1);
23801 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__47, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 287, __pyx_L1_error)
23802 __Pyx_GOTREF(__pyx_t_1);
23803 __Pyx_XGOTREF(strided);
23804 __Pyx_DECREF_SET(strided, __pyx_t_1);
23805 __Pyx_GIVEREF(__pyx_t_1);
23815 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__48, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 288, __pyx_L1_error)
23816 __Pyx_GOTREF(__pyx_t_1);
23817 __Pyx_XGOTREF(indirect);
23818 __Pyx_DECREF_SET(indirect, __pyx_t_1);
23819 __Pyx_GIVEREF(__pyx_t_1);
23829 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__49, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 291, __pyx_L1_error)
23830 __Pyx_GOTREF(__pyx_t_1);
23831 __Pyx_XGOTREF(contiguous);
23832 __Pyx_DECREF_SET(contiguous, __pyx_t_1);
23833 __Pyx_GIVEREF(__pyx_t_1);
23843 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__50, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 292, __pyx_L1_error)
23844 __Pyx_GOTREF(__pyx_t_1);
23845 __Pyx_XGOTREF(indirect_contiguous);
23846 __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_1);
23847 __Pyx_GIVEREF(__pyx_t_1);
23857 __pyx_memoryview_thread_locks_used = 0;
23866 __pyx_t_2[0] = PyThread_allocate_lock();
23867 __pyx_t_2[1] = PyThread_allocate_lock();
23868 __pyx_t_2[2] = PyThread_allocate_lock();
23869 __pyx_t_2[3] = PyThread_allocate_lock();
23870 __pyx_t_2[4] = PyThread_allocate_lock();
23871 __pyx_t_2[5] = PyThread_allocate_lock();
23872 __pyx_t_2[6] = PyThread_allocate_lock();
23873 __pyx_t_2[7] = PyThread_allocate_lock();
23874 memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_2,
sizeof(__pyx_memoryview_thread_locks[0]) * (8));
23883 __pyx_t_1 = __pyx_capsule_create(((
void *)(&__pyx_memoryview_getbuffer)), ((
char *)
"getbuffer(obj, view, flags)"));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 549, __pyx_L1_error)
23884 __Pyx_GOTREF(__pyx_t_1);
23885 if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 549, __pyx_L1_error)
23886 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23887 PyType_Modified(__pyx_memoryview_type);
23896 __pyx_t_1 = __pyx_capsule_create(((
void *)(&__pyx_memoryview_getbuffer)), ((
char *)
"getbuffer(obj, view, flags)"));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 995, __pyx_L1_error)
23897 __Pyx_GOTREF(__pyx_t_1);
23898 if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 995, __pyx_L1_error)
23899 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23900 PyType_Modified(__pyx_memoryviewslice_type);
23907 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
23908 __Pyx_GOTREF(__pyx_t_1);
23909 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
23910 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23919 __Pyx_TraceReturn(Py_None, 0);
23925 __Pyx_XDECREF(__pyx_t_1);
23928 __Pyx_AddTraceback(
"init BoundaryConditions", __pyx_clineno, __pyx_lineno, __pyx_filename);
23931 }
else if (!PyErr_Occurred()) {
23932 PyErr_SetString(PyExc_ImportError,
"init BoundaryConditions");
23935 __Pyx_RefNannyFinishContext();
23936 #if CYTHON_PEP489_MULTI_PHASE_INIT
23937 return (__pyx_m != NULL) ? 0 : -1;
23938 #elif PY_MAJOR_VERSION >= 3
23947 #if CYTHON_REFNANNY
23948 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname) {
23949 PyObject *m = NULL, *p = NULL;
23951 m = PyImport_ImportModule(modname);
23953 p = PyObject_GetAttrString(m,
"RefNannyAPI");
23955 r = PyLong_AsVoidPtr(p);
23959 return (__Pyx_RefNannyAPIStruct *)
r;
23964 #if CYTHON_USE_TYPE_SLOTS
23965 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
23966 PyTypeObject* tp = Py_TYPE(obj);
23967 if (likely(tp->tp_getattro))
23968 return tp->tp_getattro(obj, attr_name);
23969 #if PY_MAJOR_VERSION < 3
23970 if (likely(tp->tp_getattr))
23971 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
23973 return PyObject_GetAttr(obj, attr_name);
23978 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
23979 PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
23980 if (unlikely(!result)) {
23981 PyErr_Format(PyExc_NameError,
23982 #
if PY_MAJOR_VERSION >= 3
23983 "name '%U' is not defined", name);
23985 "name '%.200s' is not defined", PyString_AS_STRING(name));
23992 static void __Pyx_RaiseDoubleKeywordsError(
23993 const char* func_name,
23996 PyErr_Format(PyExc_TypeError,
23997 #
if PY_MAJOR_VERSION >= 3
23998 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
24000 "%s() got multiple values for keyword argument '%s'", func_name,
24001 PyString_AsString(kw_name));
24006 static int __Pyx_ParseOptionalKeywords(
24008 PyObject **argnames[],
24010 PyObject *values[],
24011 Py_ssize_t num_pos_args,
24012 const char* function_name)
24014 PyObject *key = 0, *value = 0;
24015 Py_ssize_t
pos = 0;
24017 PyObject*** first_kw_arg = argnames + num_pos_args;
24018 while (PyDict_Next(kwds, &
pos, &key, &value)) {
24019 name = first_kw_arg;
24020 while (*name && (**name != key)) name++;
24022 values[name-argnames] = value;
24025 name = first_kw_arg;
24026 #if PY_MAJOR_VERSION < 3
24027 if (likely(PyString_Check(key))) {
24029 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
24030 && _PyString_Eq(**name, key)) {
24031 values[name-argnames] = value;
24036 if (*name)
continue;
24038 PyObject*** argname = argnames;
24039 while (argname != first_kw_arg) {
24040 if ((**argname == key) || (
24041 (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
24042 && _PyString_Eq(**argname, key))) {
24043 goto arg_passed_twice;
24050 if (likely(PyUnicode_Check(key))) {
24052 int cmp = (**name == key) ? 0 :
24053 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
24054 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
24056 PyUnicode_Compare(**name, key);
24057 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
24059 values[name-argnames] = value;
24064 if (*name)
continue;
24066 PyObject*** argname = argnames;
24067 while (argname != first_kw_arg) {
24068 int cmp = (**argname == key) ? 0 :
24069 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
24070 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
24072 PyUnicode_Compare(**argname, key);
24073 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
24074 if (cmp == 0)
goto arg_passed_twice;
24079 goto invalid_keyword_type;
24081 if (unlikely(PyDict_SetItem(kwds2, key, value)))
goto bad;
24083 goto invalid_keyword;
24088 __Pyx_RaiseDoubleKeywordsError(function_name, key);
24090 invalid_keyword_type:
24091 PyErr_Format(PyExc_TypeError,
24092 "%.200s() keywords must be strings", function_name);
24095 PyErr_Format(PyExc_TypeError,
24096 #
if PY_MAJOR_VERSION < 3
24097 "%.200s() got an unexpected keyword argument '%.200s'",
24098 function_name, PyString_AsString(key));
24100 "%s() got an unexpected keyword argument '%U'",
24101 function_name, key);
24108 static void __Pyx_RaiseArgtupleInvalid(
24109 const char* func_name,
24111 Py_ssize_t num_min,
24112 Py_ssize_t num_max,
24113 Py_ssize_t num_found)
24115 Py_ssize_t num_expected;
24116 const char *more_or_less;
24117 if (num_found < num_min) {
24118 num_expected = num_min;
24119 more_or_less =
"at least";
24121 num_expected = num_max;
24122 more_or_less =
"at most";
24125 more_or_less =
"exactly";
24127 PyErr_Format(PyExc_TypeError,
24128 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T
"d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T
"d given)",
24129 func_name, more_or_less, num_expected,
24130 (num_expected == 1) ?
"" :
"s", num_found);
24134 #if CYTHON_FAST_THREAD_STATE
24135 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
24136 PyObject *tmp_type, *tmp_value, *tmp_tb;
24137 tmp_type = tstate->curexc_type;
24138 tmp_value = tstate->curexc_value;
24139 tmp_tb = tstate->curexc_traceback;
24140 tstate->curexc_type = type;
24141 tstate->curexc_value = value;
24142 tstate->curexc_traceback = tb;
24143 Py_XDECREF(tmp_type);
24144 Py_XDECREF(tmp_value);
24145 Py_XDECREF(tmp_tb);
24147 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
24148 *type = tstate->curexc_type;
24149 *value = tstate->curexc_value;
24150 *tb = tstate->curexc_traceback;
24151 tstate->curexc_type = 0;
24152 tstate->curexc_value = 0;
24153 tstate->curexc_traceback = 0;
24159 static int __Pyx_TraceSetupAndCall(PyCodeObject** code,
24160 PyFrameObject** frame,
24161 PyThreadState* tstate,
24162 const char *funcname,
24163 const char *srcfile,
24165 PyObject *type, *value, *traceback;
24167 if (*frame == NULL || !CYTHON_PROFILE_REUSE_FRAME) {
24168 if (*code == NULL) {
24169 *code = __Pyx_createFrameCodeObject(funcname, srcfile, firstlineno);
24170 if (*code == NULL)
return 0;
24172 *frame = PyFrame_New(
24178 if (*frame == NULL)
return 0;
24179 if (CYTHON_TRACE && (*frame)->f_trace == NULL) {
24180 Py_INCREF(Py_None);
24181 (*frame)->f_trace = Py_None;
24183 #if PY_VERSION_HEX < 0x030400B1
24185 (*frame)->f_tstate = tstate;
24188 __Pyx_PyFrame_SetLineNumber(*frame, firstlineno);
24191 __Pyx_SetTracing(tstate, 0);
24192 __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
24194 if (tstate->c_tracefunc)
24195 retval = tstate->c_tracefunc(tstate->c_traceobj, *frame, PyTrace_CALL, NULL) == 0;
24196 if (retval && tstate->c_profilefunc)
24198 retval = tstate->c_profilefunc(tstate->c_profileobj, *frame, PyTrace_CALL, NULL) == 0;
24199 __Pyx_SetTracing(tstate, (tstate->c_profilefunc || (CYTHON_TRACE && tstate->c_tracefunc)));
24202 __Pyx_ErrRestoreInState(tstate, type, value, traceback);
24203 return __Pyx_IsTracing(tstate, 0, 0) && retval;
24207 Py_XDECREF(traceback);
24211 static PyCodeObject *__Pyx_createFrameCodeObject(
const char *funcname,
const char *srcfile,
int firstlineno) {
24212 PyCodeObject *py_code = 0;
24213 #if PY_MAJOR_VERSION >= 3
24214 py_code = PyCode_NewEmpty(srcfile, funcname, firstlineno);
24215 if (likely(py_code)) {
24216 py_code->co_flags |= CO_OPTIMIZED | CO_NEWLOCALS;
24219 PyObject *py_srcfile = 0;
24220 PyObject *py_funcname = 0;
24221 py_funcname = PyString_FromString(funcname);
24222 if (unlikely(!py_funcname))
goto bad;
24223 py_srcfile = PyString_FromString(srcfile);
24224 if (unlikely(!py_srcfile))
goto bad;
24225 py_code = PyCode_New(
24229 CO_OPTIMIZED | CO_NEWLOCALS,
24242 Py_XDECREF(py_srcfile);
24243 Py_XDECREF(py_funcname);
24250 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
24252 if (!j)
return NULL;
24253 r = PyObject_GetItem(o, j);
24257 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
24258 CYTHON_NCP_UNUSED
int wraparound,
24259 CYTHON_NCP_UNUSED
int boundscheck) {
24260 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
24261 Py_ssize_t wrapped_i = i;
24262 if (wraparound & unlikely(i < 0)) {
24263 wrapped_i += PyList_GET_SIZE(o);
24265 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
24266 PyObject *
r = PyList_GET_ITEM(o, wrapped_i);
24270 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
24272 return PySequence_GetItem(o, i);
24275 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
24276 CYTHON_NCP_UNUSED
int wraparound,
24277 CYTHON_NCP_UNUSED
int boundscheck) {
24278 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
24279 Py_ssize_t wrapped_i = i;
24280 if (wraparound & unlikely(i < 0)) {
24281 wrapped_i += PyTuple_GET_SIZE(o);
24283 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
24284 PyObject *
r = PyTuple_GET_ITEM(o, wrapped_i);
24288 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
24290 return PySequence_GetItem(o, i);
24293 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
int is_list,
24294 CYTHON_NCP_UNUSED
int wraparound,
24295 CYTHON_NCP_UNUSED
int boundscheck) {
24296 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
24297 if (is_list || PyList_CheckExact(o)) {
24298 Py_ssize_t
n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
24299 if ((!boundscheck) || (likely(__Pyx_is_valid_index(
n, PyList_GET_SIZE(o))))) {
24300 PyObject *
r = PyList_GET_ITEM(o,
n);
24305 else if (PyTuple_CheckExact(o)) {
24306 Py_ssize_t
n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
24307 if ((!boundscheck) || likely(__Pyx_is_valid_index(
n, PyTuple_GET_SIZE(o)))) {
24308 PyObject *
r = PyTuple_GET_ITEM(o,
n);
24313 PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
24314 if (likely(m && m->sq_item)) {
24315 if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
24316 Py_ssize_t l = m->sq_length(o);
24317 if (likely(l >= 0)) {
24320 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
24325 return m->sq_item(o, i);
24329 if (is_list || PySequence_Check(o)) {
24330 return PySequence_GetItem(o, i);
24333 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
24337 #if CYTHON_USE_TYPE_SLOTS
24338 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
24340 Py_ssize_t key_value;
24341 PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
24342 if (unlikely(!(m && m->sq_item))) {
24343 PyErr_Format(PyExc_TypeError,
"'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
24346 key_value = __Pyx_PyIndex_AsSsize_t(index);
24347 if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
24348 return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
24350 if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
24352 PyErr_Format(PyExc_IndexError,
"cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
24356 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
24357 PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
24358 if (likely(m && m->mp_subscript)) {
24359 return m->mp_subscript(obj, key);
24361 return __Pyx_PyObject_GetIndex(obj, key);
24367 __Pyx_init_memviewslice(
struct __pyx_memoryview_obj *memview,
24369 __Pyx_memviewslice *memviewslice,
24370 int memview_is_new_reference)
24372 __Pyx_RefNannyDeclarations
24374 Py_buffer *buf = &memview->view;
24375 __Pyx_RefNannySetupContext(
"init_memviewslice", 0);
24376 if (unlikely(memviewslice->memview || memviewslice->data)) {
24377 PyErr_SetString(PyExc_ValueError,
24378 "memviewslice is already initialized!");
24381 if (buf->strides) {
24382 for (i = 0; i < ndim; i++) {
24383 memviewslice->strides[i] = buf->strides[i];
24386 Py_ssize_t stride = buf->itemsize;
24387 for (i = ndim - 1; i >= 0; i--) {
24388 memviewslice->strides[i] = stride;
24389 stride *= buf->shape[i];
24392 for (i = 0; i < ndim; i++) {
24393 memviewslice->shape[i] = buf->shape[i];
24394 if (buf->suboffsets) {
24395 memviewslice->suboffsets[i] = buf->suboffsets[i];
24397 memviewslice->suboffsets[i] = -1;
24400 memviewslice->memview = memview;
24401 memviewslice->data = (
char *)buf->buf;
24402 if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
24403 Py_INCREF(memview);
24408 memviewslice->memview = 0;
24409 memviewslice->data = 0;
24412 __Pyx_RefNannyFinishContext();
24415 #ifndef Py_NO_RETURN
24416 #define Py_NO_RETURN
24418 static void __pyx_fatalerror(
const char *fmt, ...) Py_NO_RETURN {
24421 #ifdef HAVE_STDARG_PROTOTYPES
24422 va_start(vargs, fmt);
24426 vsnprintf(msg, 200, fmt, vargs);
24428 Py_FatalError(msg);
24430 static CYTHON_INLINE
int
24431 __pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
24432 PyThread_type_lock lock)
24435 PyThread_acquire_lock(lock, 1);
24436 result = (*acquisition_count)++;
24437 PyThread_release_lock(lock);
24440 static CYTHON_INLINE
int
24441 __pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
24442 PyThread_type_lock lock)
24445 PyThread_acquire_lock(lock, 1);
24446 result = (*acquisition_count)--;
24447 PyThread_release_lock(lock);
24450 static CYTHON_INLINE
void
24451 __Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice,
int have_gil,
int lineno)
24454 struct __pyx_memoryview_obj *memview = memslice->memview;
24455 if (unlikely(!memview || (PyObject *) memview == Py_None))
24457 if (unlikely(__pyx_get_slice_count(memview) < 0))
24458 __pyx_fatalerror(
"Acquisition count is %d (line %d)",
24459 __pyx_get_slice_count(memview), lineno);
24460 first_time = __pyx_add_acquisition_count(memview) == 0;
24461 if (unlikely(first_time)) {
24463 Py_INCREF((PyObject *) memview);
24465 PyGILState_STATE _gilstate = PyGILState_Ensure();
24466 Py_INCREF((PyObject *) memview);
24467 PyGILState_Release(_gilstate);
24471 static CYTHON_INLINE
void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
24472 int have_gil,
int lineno) {
24474 struct __pyx_memoryview_obj *memview = memslice->memview;
24475 if (unlikely(!memview || (PyObject *) memview == Py_None)) {
24476 memslice->memview = NULL;
24479 if (unlikely(__pyx_get_slice_count(memview) <= 0))
24480 __pyx_fatalerror(
"Acquisition count is %d (line %d)",
24481 __pyx_get_slice_count(memview), lineno);
24482 last_time = __pyx_sub_acquisition_count(memview) == 1;
24483 memslice->data = NULL;
24484 if (unlikely(last_time)) {
24486 Py_CLEAR(memslice->memview);
24488 PyGILState_STATE _gilstate = PyGILState_Ensure();
24489 Py_CLEAR(memslice->memview);
24490 PyGILState_Release(_gilstate);
24493 memslice->memview = NULL;
24498 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level) {
24499 PyObject *empty_list = 0;
24500 PyObject *module = 0;
24501 PyObject *global_dict = 0;
24502 PyObject *empty_dict = 0;
24504 #if PY_MAJOR_VERSION < 3
24505 PyObject *py_import;
24506 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
24513 empty_list = PyList_New(0);
24518 global_dict = PyModule_GetDict(__pyx_m);
24521 empty_dict = PyDict_New();
24525 #if PY_MAJOR_VERSION >= 3
24527 if ((1) && (strchr(__Pyx_MODULE_NAME,
'.'))) {
24528 module = PyImport_ImportModuleLevelObject(
24529 name, global_dict, empty_dict, list, 1);
24531 if (!PyErr_ExceptionMatches(PyExc_ImportError))
24540 #if PY_MAJOR_VERSION < 3
24541 PyObject *py_level = PyInt_FromLong(level);
24544 module = PyObject_CallFunctionObjArgs(py_import,
24545 name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
24546 Py_DECREF(py_level);
24548 module = PyImport_ImportModuleLevelObject(
24549 name, global_dict, empty_dict, list, level);
24554 #if PY_MAJOR_VERSION < 3
24555 Py_XDECREF(py_import);
24557 Py_XDECREF(empty_list);
24558 Py_XDECREF(empty_dict);
24563 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
24564 PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
24565 if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
24566 PyErr_Format(PyExc_ImportError,
24567 #
if PY_MAJOR_VERSION < 3
24568 "cannot import name %.230s", PyString_AS_STRING(name));
24570 "cannot import name %S", name);
24577 #if CYTHON_FAST_PYCALL
24578 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
24579 PyObject *globals) {
24581 PyThreadState *tstate = __Pyx_PyThreadState_Current;
24582 PyObject **fastlocals;
24585 assert(globals != NULL);
24590 assert(tstate != NULL);
24591 f = PyFrame_New(tstate, co, globals, NULL);
24595 fastlocals = __Pyx_PyFrame_GetLocalsplus(
f);
24596 for (i = 0; i < na; i++) {
24598 fastlocals[i] = *args++;
24600 result = PyEval_EvalFrameEx(
f,0);
24601 ++tstate->recursion_depth;
24603 --tstate->recursion_depth;
24606 #if 1 || PY_VERSION_HEX < 0x030600B1
24607 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
24608 PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
24609 PyObject *globals = PyFunction_GET_GLOBALS(func);
24610 PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
24612 #if PY_MAJOR_VERSION >= 3
24615 PyObject *kwtuple, **k;
24620 assert(kwargs == NULL || PyDict_Check(kwargs));
24621 nk = kwargs ? PyDict_Size(kwargs) : 0;
24622 if (Py_EnterRecursiveCall((
char*)
" while calling a Python object")) {
24626 #
if PY_MAJOR_VERSION >= 3
24627 co->co_kwonlyargcount == 0 &&
24629 likely(kwargs == NULL || nk == 0) &&
24630 co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
24631 if (argdefs == NULL && co->co_argcount == nargs) {
24632 result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
24635 else if (nargs == 0 && argdefs != NULL
24636 && co->co_argcount == Py_SIZE(argdefs)) {
24639 args = &PyTuple_GET_ITEM(argdefs, 0);
24640 result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
24644 if (kwargs != NULL) {
24646 kwtuple = PyTuple_New(2 * nk);
24647 if (kwtuple == NULL) {
24651 k = &PyTuple_GET_ITEM(kwtuple, 0);
24653 while (PyDict_Next(kwargs, &
pos, &k[i], &k[i+1])) {
24664 closure = PyFunction_GET_CLOSURE(func);
24665 #if PY_MAJOR_VERSION >= 3
24666 kwdefs = PyFunction_GET_KW_DEFAULTS(func);
24668 if (argdefs != NULL) {
24669 d = &PyTuple_GET_ITEM(argdefs, 0);
24670 nd = Py_SIZE(argdefs);
24676 #if PY_MAJOR_VERSION >= 3
24677 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
24680 d, (
int)nd, kwdefs, closure);
24682 result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
24685 d, (
int)nd, closure);
24687 Py_XDECREF(kwtuple);
24689 Py_LeaveRecursiveCall();
24696 #if CYTHON_COMPILING_IN_CPYTHON
24697 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
24699 ternaryfunc call = Py_TYPE(func)->tp_call;
24700 if (unlikely(!call))
24701 return PyObject_Call(func, arg, kw);
24702 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
24704 result = (*call)(func, arg, kw);
24705 Py_LeaveRecursiveCall();
24706 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
24709 "NULL result without error in PyObject_Call");
24716 #if CYTHON_COMPILING_IN_CPYTHON
24717 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
24718 PyObject *
self, *result;
24720 cfunc = PyCFunction_GET_FUNCTION(func);
24721 self = PyCFunction_GET_SELF(func);
24722 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
24724 result = cfunc(
self, arg);
24725 Py_LeaveRecursiveCall();
24726 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
24729 "NULL result without error in PyObject_Call");
24736 #if CYTHON_COMPILING_IN_CPYTHON
24737 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
24738 #if CYTHON_FAST_PYCALL
24739 if (PyFunction_Check(func)) {
24740 return __Pyx_PyFunction_FastCall(func, NULL, 0);
24743 #ifdef __Pyx_CyFunction_USED
24744 if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
24746 if (likely(PyCFunction_Check(func)))
24749 if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
24750 return __Pyx_PyObject_CallMethO(func, NULL);
24753 return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
24758 #if CYTHON_FAST_PYCCALL
24759 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
24760 PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
24761 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
24762 PyObject *
self = PyCFunction_GET_SELF(func);
24763 int flags = PyCFunction_GET_FLAGS(func);
24764 assert(PyCFunction_Check(func));
24765 assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
24766 assert(nargs >= 0);
24767 assert(nargs == 0 || args != NULL);
24771 assert(!PyErr_Occurred());
24772 if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
24773 return (*((__Pyx_PyCFunctionFastWithKeywords)(
void*)meth)) (
self, args, nargs, NULL);
24775 return (*((__Pyx_PyCFunctionFast)(
void*)meth)) (
self, args, nargs);
24781 #if CYTHON_COMPILING_IN_CPYTHON
24782 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24784 PyObject *args = PyTuple_New(1);
24785 if (unlikely(!args))
return NULL;
24787 PyTuple_SET_ITEM(args, 0, arg);
24788 result = __Pyx_PyObject_Call(func, args, NULL);
24792 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24793 #if CYTHON_FAST_PYCALL
24794 if (PyFunction_Check(func)) {
24795 return __Pyx_PyFunction_FastCall(func, &arg, 1);
24798 if (likely(PyCFunction_Check(func))) {
24799 if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
24800 return __Pyx_PyObject_CallMethO(func, arg);
24801 #if CYTHON_FAST_PYCCALL
24802 }
else if (__Pyx_PyFastCFunction_Check(func)) {
24803 return __Pyx_PyCFunction_FastCall(func, &arg, 1);
24807 return __Pyx__PyObject_CallOneArg(func, arg);
24810 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24812 PyObject *args = PyTuple_Pack(1, arg);
24813 if (unlikely(!args))
return NULL;
24814 result = __Pyx_PyObject_Call(func, args, NULL);
24821 #if CYTHON_FAST_THREAD_STATE
24822 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
24824 n = PyTuple_GET_SIZE(tuple);
24825 #if PY_MAJOR_VERSION >= 3
24826 for (i=0; i<
n; i++) {
24827 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
24830 for (i=0; i<
n; i++) {
24831 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i)))
return 1;
24835 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
24836 PyObject *exc_type = tstate->curexc_type;
24837 if (exc_type == err)
return 1;
24838 if (unlikely(!exc_type))
return 0;
24839 if (unlikely(PyTuple_Check(err)))
24840 return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
24841 return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
24846 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *
n) {
24847 #if CYTHON_USE_TYPE_SLOTS
24848 #if PY_MAJOR_VERSION >= 3
24849 if (likely(PyUnicode_Check(
n)))
24851 if (likely(PyString_Check(
n)))
24853 return __Pyx_PyObject_GetAttrStr(o,
n);
24855 return PyObject_GetAttr(o,
n);
24859 static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
24860 __Pyx_PyThreadState_declare
24861 __Pyx_PyThreadState_assign
24862 if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
24864 __Pyx_PyErr_Clear();
24868 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *
n, PyObject *d) {
24869 PyObject *
r = __Pyx_GetAttr(o,
n);
24870 return (likely(
r)) ?
r : __Pyx_GetAttr3Default(d);
24874 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
24875 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
24876 PyObject *dict = Py_TYPE(obj)->tp_dict;
24877 return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
24879 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
24880 PyObject **dictptr = NULL;
24881 Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
24883 #if CYTHON_COMPILING_IN_CPYTHON
24884 dictptr = (likely(offset > 0)) ? (PyObject **) ((
char *)obj + offset) : _PyObject_GetDictPtr(obj);
24886 dictptr = _PyObject_GetDictPtr(obj);
24889 return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
24891 static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
24892 PyObject *dict = Py_TYPE(obj)->tp_dict;
24893 if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
24895 return obj_dict_version == __Pyx_get_object_dict_version(obj);
24900 #if CYTHON_USE_DICT_VERSIONS
24901 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
24903 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
24907 #if !CYTHON_AVOID_BORROWED_REFS
24908 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
24909 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
24910 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
24911 if (likely(result)) {
24912 return __Pyx_NewRef(result);
24913 }
else if (unlikely(PyErr_Occurred())) {
24917 result = PyDict_GetItem(__pyx_d, name);
24918 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
24919 if (likely(result)) {
24920 return __Pyx_NewRef(result);
24924 result = PyObject_GetItem(__pyx_d, name);
24925 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
24926 if (likely(result)) {
24927 return __Pyx_NewRef(result);
24931 return __Pyx_GetBuiltinName(name);
24935 static int __Pyx_CheckKeywordStrings(
24937 const char* function_name,
24941 Py_ssize_t
pos = 0;
24942 #if CYTHON_COMPILING_IN_PYPY
24943 if (!kw_allowed && PyDict_Next(kwdict, &
pos, &key, 0))
24944 goto invalid_keyword;
24947 while (PyDict_Next(kwdict, &
pos, &key, 0)) {
24948 #if PY_MAJOR_VERSION < 3
24949 if (unlikely(!PyString_Check(key)))
24951 if (unlikely(!PyUnicode_Check(key)))
24952 goto invalid_keyword_type;
24954 if ((!kw_allowed) && unlikely(key))
24955 goto invalid_keyword;
24957 invalid_keyword_type:
24958 PyErr_Format(PyExc_TypeError,
24959 "%.200s() keywords must be strings", function_name);
24963 PyErr_Format(PyExc_TypeError,
24964 #
if PY_MAJOR_VERSION < 3
24965 "%.200s() got an unexpected keyword argument '%.200s'",
24966 function_name, PyString_AsString(key));
24968 "%s() got an unexpected keyword argument '%U'",
24969 function_name, key);
24975 static void __Pyx_WriteUnraisable(
const char *name, CYTHON_UNUSED
int clineno,
24976 CYTHON_UNUSED
int lineno, CYTHON_UNUSED
const char *filename,
24977 int full_traceback, CYTHON_UNUSED
int nogil) {
24978 PyObject *old_exc, *old_val, *old_tb;
24980 __Pyx_PyThreadState_declare
24982 PyGILState_STATE state;
24984 state = PyGILState_Ensure();
24986 else state = (PyGILState_STATE)-1;
24989 __Pyx_PyThreadState_assign
24990 __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
24991 if (full_traceback) {
24992 Py_XINCREF(old_exc);
24993 Py_XINCREF(old_val);
24994 Py_XINCREF(old_tb);
24995 __Pyx_ErrRestore(old_exc, old_val, old_tb);
24998 #if PY_MAJOR_VERSION < 3
24999 ctx = PyString_FromString(name);
25001 ctx = PyUnicode_FromString(name);
25003 __Pyx_ErrRestore(old_exc, old_val, old_tb);
25005 PyErr_WriteUnraisable(Py_None);
25007 PyErr_WriteUnraisable(ctx);
25012 PyGILState_Release(state);
25017 static CYTHON_INLINE
void __Pyx_RaiseClosureNameError(
const char *varname) {
25018 PyErr_Format(PyExc_NameError,
"free variable '%s' referenced before assignment in enclosing scope", varname);
25022 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
25023 PyObject* fake_module;
25024 PyTypeObject* cached_type = NULL;
25025 fake_module = PyImport_AddModule((
char*)
"_cython_" CYTHON_ABI);
25026 if (!fake_module)
return NULL;
25027 Py_INCREF(fake_module);
25028 cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
25030 if (!PyType_Check((PyObject*)cached_type)) {
25031 PyErr_Format(PyExc_TypeError,
25032 "Shared Cython type %.200s is not a type object",
25036 if (cached_type->tp_basicsize != type->tp_basicsize) {
25037 PyErr_Format(PyExc_TypeError,
25038 "Shared Cython type %.200s has the wrong size, try recompiling",
25043 if (!PyErr_ExceptionMatches(PyExc_AttributeError))
goto bad;
25045 if (PyType_Ready(type) < 0)
goto bad;
25046 if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
25049 cached_type = type;
25052 Py_DECREF(fake_module);
25053 return cached_type;
25055 Py_XDECREF(cached_type);
25056 cached_type = NULL;
25061 #include <structmember.h>
25063 __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *closure)
25065 if (unlikely(op->func_doc == NULL)) {
25066 if (op->func.m_ml->ml_doc) {
25067 #if PY_MAJOR_VERSION >= 3
25068 op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
25070 op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
25072 if (unlikely(op->func_doc == NULL))
25075 Py_INCREF(Py_None);
25079 Py_INCREF(op->func_doc);
25080 return op->func_doc;
25083 __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED
void *context)
25085 PyObject *tmp = op->func_doc;
25086 if (value == NULL) {
25090 op->func_doc = value;
25095 __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
25097 if (unlikely(op->func_name == NULL)) {
25098 #if PY_MAJOR_VERSION >= 3
25099 op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
25101 op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
25103 if (unlikely(op->func_name == NULL))
25106 Py_INCREF(op->func_name);
25107 return op->func_name;
25110 __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED
void *context)
25113 #if PY_MAJOR_VERSION >= 3
25114 if (unlikely(value == NULL || !PyUnicode_Check(value)))
25116 if (unlikely(value == NULL || !PyString_Check(value)))
25119 PyErr_SetString(PyExc_TypeError,
25120 "__name__ must be set to a string object");
25123 tmp = op->func_name;
25125 op->func_name = value;
25130 __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
25132 Py_INCREF(op->func_qualname);
25133 return op->func_qualname;
25136 __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED
void *context)
25139 #if PY_MAJOR_VERSION >= 3
25140 if (unlikely(value == NULL || !PyUnicode_Check(value)))
25142 if (unlikely(value == NULL || !PyString_Check(value)))
25145 PyErr_SetString(PyExc_TypeError,
25146 "__qualname__ must be set to a string object");
25149 tmp = op->func_qualname;
25151 op->func_qualname = value;
25156 __Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED
void *closure)
25159 self = m->func_closure;
25166 __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
25168 if (unlikely(op->func_dict == NULL)) {
25169 op->func_dict = PyDict_New();
25170 if (unlikely(op->func_dict == NULL))
25173 Py_INCREF(op->func_dict);
25174 return op->func_dict;
25177 __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED
void *context)
25180 if (unlikely(value == NULL)) {
25181 PyErr_SetString(PyExc_TypeError,
25182 "function's dictionary may not be deleted");
25185 if (unlikely(!PyDict_Check(value))) {
25186 PyErr_SetString(PyExc_TypeError,
25187 "setting function's dictionary to a non-dict");
25190 tmp = op->func_dict;
25192 op->func_dict = value;
25197 __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
25199 Py_INCREF(op->func_globals);
25200 return op->func_globals;
25203 __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
25205 Py_INCREF(Py_None);
25209 __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
25211 PyObject* result = (op->func_code) ? op->func_code : Py_None;
25216 __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
25218 PyObject *res = op->defaults_getter((PyObject *) op);
25219 if (unlikely(!res))
25221 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
25222 op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
25223 Py_INCREF(op->defaults_tuple);
25224 op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
25225 Py_INCREF(op->defaults_kwdict);
25227 op->defaults_tuple = PySequence_ITEM(res, 0);
25228 if (unlikely(!op->defaults_tuple)) result = -1;
25230 op->defaults_kwdict = PySequence_ITEM(res, 1);
25231 if (unlikely(!op->defaults_kwdict)) result = -1;
25238 __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED
void *context) {
25242 }
else if (value != Py_None && !PyTuple_Check(value)) {
25243 PyErr_SetString(PyExc_TypeError,
25244 "__defaults__ must be set to a tuple object");
25248 tmp = op->defaults_tuple;
25249 op->defaults_tuple = value;
25254 __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context) {
25255 PyObject* result = op->defaults_tuple;
25256 if (unlikely(!result)) {
25257 if (op->defaults_getter) {
25258 if (__Pyx_CyFunction_init_defaults(op) < 0)
return NULL;
25259 result = op->defaults_tuple;
25268 __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED
void *context) {
25272 }
else if (value != Py_None && !PyDict_Check(value)) {
25273 PyErr_SetString(PyExc_TypeError,
25274 "__kwdefaults__ must be set to a dict object");
25278 tmp = op->defaults_kwdict;
25279 op->defaults_kwdict = value;
25284 __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context) {
25285 PyObject* result = op->defaults_kwdict;
25286 if (unlikely(!result)) {
25287 if (op->defaults_getter) {
25288 if (__Pyx_CyFunction_init_defaults(op) < 0)
return NULL;
25289 result = op->defaults_kwdict;
25298 __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED
void *context) {
25300 if (!value || value == Py_None) {
25302 }
else if (!PyDict_Check(value)) {
25303 PyErr_SetString(PyExc_TypeError,
25304 "__annotations__ must be set to a dict object");
25308 tmp = op->func_annotations;
25309 op->func_annotations = value;
25314 __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context) {
25315 PyObject* result = op->func_annotations;
25316 if (unlikely(!result)) {
25317 result = PyDict_New();
25318 if (unlikely(!result))
return NULL;
25319 op->func_annotations = result;
25324 static PyGetSetDef __pyx_CyFunction_getsets[] = {
25325 {(
char *)
"func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
25326 {(
char *)
"__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
25327 {(
char *)
"func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
25328 {(
char *)
"__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
25329 {(
char *)
"__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
25330 {(
char *)
"__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
25331 {(
char *)
"func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
25332 {(
char *)
"__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
25333 {(
char *)
"func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
25334 {(
char *)
"__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
25335 {(
char *)
"func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
25336 {(
char *)
"__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
25337 {(
char *)
"func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
25338 {(
char *)
"__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
25339 {(
char *)
"func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
25340 {(
char *)
"__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
25341 {(
char *)
"__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
25342 {(
char *)
"__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
25345 static PyMemberDef __pyx_CyFunction_members[] = {
25346 {(
char *)
"__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
25350 __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
25352 #if PY_MAJOR_VERSION >= 3
25353 Py_INCREF(m->func_qualname);
25354 return m->func_qualname;
25356 return PyString_FromString(m->func.m_ml->ml_name);
25359 static PyMethodDef __pyx_CyFunction_methods[] = {
25360 {
"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
25363 #if PY_VERSION_HEX < 0x030500A0
25364 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
25366 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
25368 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml,
int flags, PyObject* qualname,
25369 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
25370 if (unlikely(op == NULL))
25373 __Pyx_CyFunction_weakreflist(op) = NULL;
25374 op->func.m_ml = ml;
25375 op->func.m_self = (PyObject *) op;
25376 Py_XINCREF(closure);
25377 op->func_closure = closure;
25378 Py_XINCREF(module);
25379 op->func.m_module = module;
25380 op->func_dict = NULL;
25381 op->func_name = NULL;
25382 Py_INCREF(qualname);
25383 op->func_qualname = qualname;
25384 op->func_doc = NULL;
25385 op->func_classobj = NULL;
25386 op->func_globals = globals;
25387 Py_INCREF(op->func_globals);
25389 op->func_code = code;
25390 op->defaults_pyobjects = 0;
25391 op->defaults_size = 0;
25392 op->defaults = NULL;
25393 op->defaults_tuple = NULL;
25394 op->defaults_kwdict = NULL;
25395 op->defaults_getter = NULL;
25396 op->func_annotations = NULL;
25397 return (PyObject *) op;
25400 __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
25402 Py_CLEAR(m->func_closure);
25403 Py_CLEAR(m->func.m_module);
25404 Py_CLEAR(m->func_dict);
25405 Py_CLEAR(m->func_name);
25406 Py_CLEAR(m->func_qualname);
25407 Py_CLEAR(m->func_doc);
25408 Py_CLEAR(m->func_globals);
25409 Py_CLEAR(m->func_code);
25410 Py_CLEAR(m->func_classobj);
25411 Py_CLEAR(m->defaults_tuple);
25412 Py_CLEAR(m->defaults_kwdict);
25413 Py_CLEAR(m->func_annotations);
25415 PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
25417 for (i = 0; i < m->defaults_pyobjects; i++)
25418 Py_XDECREF(pydefaults[i]);
25419 PyObject_Free(m->defaults);
25420 m->defaults = NULL;
25424 static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
25426 if (__Pyx_CyFunction_weakreflist(m) != NULL)
25427 PyObject_ClearWeakRefs((PyObject *) m);
25428 __Pyx_CyFunction_clear(m);
25429 PyObject_GC_Del(m);
25431 static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
25433 PyObject_GC_UnTrack(m);
25434 __Pyx__CyFunction_dealloc(m);
25436 static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit,
void *arg)
25438 Py_VISIT(m->func_closure);
25439 Py_VISIT(m->func.m_module);
25440 Py_VISIT(m->func_dict);
25441 Py_VISIT(m->func_name);
25442 Py_VISIT(m->func_qualname);
25443 Py_VISIT(m->func_doc);
25444 Py_VISIT(m->func_globals);
25445 Py_VISIT(m->func_code);
25446 Py_VISIT(m->func_classobj);
25447 Py_VISIT(m->defaults_tuple);
25448 Py_VISIT(m->defaults_kwdict);
25450 PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
25452 for (i = 0; i < m->defaults_pyobjects; i++)
25453 Py_VISIT(pydefaults[i]);
25457 static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
25459 #if PY_MAJOR_VERSION < 3
25460 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
25461 if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
25465 if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
25467 type = (PyObject *)(Py_TYPE(obj));
25468 return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
25470 if (obj == Py_None)
25473 return __Pyx_PyMethod_New(func, obj, type);
25476 __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
25478 #if PY_MAJOR_VERSION >= 3
25479 return PyUnicode_FromFormat(
"<cyfunction %U at %p>",
25480 op->func_qualname, (
void *)op);
25482 return PyString_FromFormat(
"<cyfunction %s at %p>",
25483 PyString_AsString(op->func_qualname), (
void *)op);
25486 static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *
self, PyObject *arg, PyObject *kw) {
25487 PyCFunctionObject*
f = (PyCFunctionObject*)func;
25488 PyCFunction meth =
f->m_ml->ml_meth;
25490 switch (
f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
25492 if (likely(kw == NULL || PyDict_Size(kw) == 0))
25493 return (*meth)(
self, arg);
25495 case METH_VARARGS | METH_KEYWORDS:
25496 return (*(PyCFunctionWithKeywords)(
void*)meth)(
self, arg, kw);
25498 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
25499 size = PyTuple_GET_SIZE(arg);
25500 if (likely(size == 0))
25501 return (*meth)(
self, NULL);
25502 PyErr_Format(PyExc_TypeError,
25503 "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T
"d given)",
25504 f->m_ml->ml_name, size);
25509 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
25510 size = PyTuple_GET_SIZE(arg);
25511 if (likely(size == 1)) {
25512 PyObject *result, *arg0;
25513 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
25514 arg0 = PyTuple_GET_ITEM(arg, 0);
25516 arg0 = PySequence_ITEM(arg, 0);
if (unlikely(!arg0))
return NULL;
25518 result = (*meth)(
self, arg0);
25519 #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
25524 PyErr_Format(PyExc_TypeError,
25525 "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T
"d given)",
25526 f->m_ml->ml_name, size);
25531 PyErr_SetString(PyExc_SystemError,
"Bad call flags in "
25532 "__Pyx_CyFunction_Call. METH_OLDARGS is no "
25533 "longer supported!");
25536 PyErr_Format(PyExc_TypeError,
"%.200s() takes no keyword arguments",
25540 static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
25541 return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
25543 static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
25545 __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
25546 if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
25548 PyObject *new_args;
25550 argc = PyTuple_GET_SIZE(args);
25551 new_args = PyTuple_GetSlice(args, 1, argc);
25552 if (unlikely(!new_args))
25554 self = PyTuple_GetItem(args, 0);
25555 if (unlikely(!
self)) {
25556 Py_DECREF(new_args);
25559 result = __Pyx_CyFunction_CallMethod(func,
self, new_args, kw);
25560 Py_DECREF(new_args);
25562 result = __Pyx_CyFunction_Call(func, args, kw);
25566 static PyTypeObject __pyx_CyFunctionType_type = {
25567 PyVarObject_HEAD_INIT(0, 0)
25568 "cython_function_or_method",
25569 sizeof(__pyx_CyFunctionObject),
25571 (destructor) __Pyx_CyFunction_dealloc,
25575 #if PY_MAJOR_VERSION < 3
25580 (reprfunc) __Pyx_CyFunction_repr,
25585 __Pyx_CyFunction_CallAsMethod,
25590 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
25592 (traverseproc) __Pyx_CyFunction_traverse,
25593 (inquiry) __Pyx_CyFunction_clear,
25595 #
if PY_VERSION_HEX < 0x030500A0
25596 offsetof(__pyx_CyFunctionObject, func_weakreflist),
25598 offsetof(PyCFunctionObject, m_weakreflist),
25602 __pyx_CyFunction_methods,
25603 __pyx_CyFunction_members,
25604 __pyx_CyFunction_getsets,
25607 __Pyx_CyFunction_descr_get,
25609 offsetof(__pyx_CyFunctionObject, func_dict),
25622 #if PY_VERSION_HEX >= 0x030400a1
25625 #if PY_VERSION_HEX >= 0x030800b1
25628 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
25632 static int __pyx_CyFunction_init(
void) {
25633 __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
25634 if (unlikely(__pyx_CyFunctionType == NULL)) {
25639 static CYTHON_INLINE
void *__Pyx_CyFunction_InitDefaults(PyObject *func,
size_t size,
int pyobjects) {
25640 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
25641 m->defaults = PyObject_Malloc(size);
25642 if (unlikely(!m->defaults))
25643 return PyErr_NoMemory();
25644 memset(m->defaults, 0, size);
25645 m->defaults_pyobjects = pyobjects;
25646 m->defaults_size = size;
25647 return m->defaults;
25649 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
25650 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
25651 m->defaults_tuple = tuple;
25654 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
25655 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
25656 m->defaults_kwdict = dict;
25659 static CYTHON_INLINE
void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
25660 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
25661 m->func_annotations = dict;
25666 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
int flags, PyObject* qualname,
25667 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
25668 PyObject *op = __Pyx_CyFunction_Init(
25669 PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType),
25670 ml, flags, qualname, closure, module, globals, code
25673 PyObject_GC_Track(op);
25679 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject*
function, PyObject* arg1, PyObject* arg2) {
25680 PyObject *args, *result = NULL;
25681 #if CYTHON_FAST_PYCALL
25682 if (PyFunction_Check(
function)) {
25683 PyObject *args[2] = {arg1, arg2};
25684 return __Pyx_PyFunction_FastCall(
function, args, 2);
25687 #if CYTHON_FAST_PYCCALL
25688 if (__Pyx_PyFastCFunction_Check(
function)) {
25689 PyObject *args[2] = {arg1, arg2};
25690 return __Pyx_PyCFunction_FastCall(
function, args, 2);
25693 args = PyTuple_New(2);
25694 if (unlikely(!args))
goto done;
25696 PyTuple_SET_ITEM(args, 0, arg1);
25698 PyTuple_SET_ITEM(args, 1, arg2);
25699 Py_INCREF(
function);
25700 result = __Pyx_PyObject_Call(
function, args, NULL);
25702 Py_DECREF(
function);
25708 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj,
25709 Py_ssize_t cstart, Py_ssize_t cstop,
25710 PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
25711 int has_cstart,
int has_cstop, CYTHON_UNUSED
int wraparound) {
25712 #if CYTHON_USE_TYPE_SLOTS
25713 PyMappingMethods* mp;
25714 #if PY_MAJOR_VERSION < 3
25715 PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
25716 if (likely(ms && ms->sq_slice)) {
25718 if (_py_start && (*_py_start != Py_None)) {
25719 cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
25720 if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred())
goto bad;
25725 if (_py_stop && (*_py_stop != Py_None)) {
25726 cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
25727 if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred())
goto bad;
25729 cstop = PY_SSIZE_T_MAX;
25731 if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
25732 Py_ssize_t l = ms->sq_length(obj);
25733 if (likely(l >= 0)) {
25736 if (cstop < 0) cstop = 0;
25740 if (cstart < 0) cstart = 0;
25743 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
25748 return ms->sq_slice(obj, cstart, cstop);
25751 mp = Py_TYPE(obj)->tp_as_mapping;
25752 if (likely(mp && mp->mp_subscript))
25756 PyObject *py_slice, *py_start, *py_stop;
25758 py_slice = *_py_slice;
25760 PyObject* owned_start = NULL;
25761 PyObject* owned_stop = NULL;
25763 py_start = *_py_start;
25766 owned_start = py_start = PyInt_FromSsize_t(cstart);
25767 if (unlikely(!py_start))
goto bad;
25769 py_start = Py_None;
25772 py_stop = *_py_stop;
25775 owned_stop = py_stop = PyInt_FromSsize_t(cstop);
25776 if (unlikely(!py_stop)) {
25777 Py_XDECREF(owned_start);
25783 py_slice = PySlice_New(py_start, py_stop, Py_None);
25784 Py_XDECREF(owned_start);
25785 Py_XDECREF(owned_stop);
25786 if (unlikely(!py_slice))
goto bad;
25788 #if CYTHON_USE_TYPE_SLOTS
25789 result = mp->mp_subscript(obj, py_slice);
25791 result = PyObject_GetItem(obj, py_slice);
25794 Py_DECREF(py_slice);
25798 PyErr_Format(PyExc_TypeError,
25799 "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name);
25805 #if PY_MAJOR_VERSION < 3
25806 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
25807 CYTHON_UNUSED PyObject *cause) {
25808 __Pyx_PyThreadState_declare
25810 if (!value || value == Py_None)
25814 if (!tb || tb == Py_None)
25818 if (!PyTraceBack_Check(tb)) {
25819 PyErr_SetString(PyExc_TypeError,
25820 "raise: arg 3 must be a traceback or None");
25824 if (PyType_Check(type)) {
25825 #if CYTHON_COMPILING_IN_PYPY
25827 Py_INCREF(Py_None);
25831 PyErr_NormalizeException(&type, &value, &tb);
25834 PyErr_SetString(PyExc_TypeError,
25835 "instance exception may not have a separate value");
25839 type = (PyObject*) Py_TYPE(type);
25841 if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
25842 PyErr_SetString(PyExc_TypeError,
25843 "raise: exception class must be a subclass of BaseException");
25847 __Pyx_PyThreadState_assign
25848 __Pyx_ErrRestore(type, value, tb);
25857 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
25858 PyObject* owned_instance = NULL;
25859 if (tb == Py_None) {
25861 }
else if (tb && !PyTraceBack_Check(tb)) {
25862 PyErr_SetString(PyExc_TypeError,
25863 "raise: arg 3 must be a traceback or None");
25866 if (value == Py_None)
25868 if (PyExceptionInstance_Check(type)) {
25870 PyErr_SetString(PyExc_TypeError,
25871 "instance exception may not have a separate value");
25875 type = (PyObject*) Py_TYPE(value);
25876 }
else if (PyExceptionClass_Check(type)) {
25877 PyObject *instance_class = NULL;
25878 if (value && PyExceptionInstance_Check(value)) {
25879 instance_class = (PyObject*) Py_TYPE(value);
25880 if (instance_class != type) {
25881 int is_subclass = PyObject_IsSubclass(instance_class, type);
25882 if (!is_subclass) {
25883 instance_class = NULL;
25884 }
else if (unlikely(is_subclass == -1)) {
25887 type = instance_class;
25891 if (!instance_class) {
25894 args = PyTuple_New(0);
25895 else if (PyTuple_Check(value)) {
25899 args = PyTuple_Pack(1, value);
25902 owned_instance = PyObject_Call(type, args, NULL);
25904 if (!owned_instance)
25906 value = owned_instance;
25907 if (!PyExceptionInstance_Check(value)) {
25908 PyErr_Format(PyExc_TypeError,
25909 "calling %R should have returned an instance of "
25910 "BaseException, not %R",
25911 type, Py_TYPE(value));
25916 PyErr_SetString(PyExc_TypeError,
25917 "raise: exception class must be a subclass of BaseException");
25921 PyObject *fixed_cause;
25922 if (cause == Py_None) {
25923 fixed_cause = NULL;
25924 }
else if (PyExceptionClass_Check(cause)) {
25925 fixed_cause = PyObject_CallObject(cause, NULL);
25926 if (fixed_cause == NULL)
25928 }
else if (PyExceptionInstance_Check(cause)) {
25929 fixed_cause = cause;
25930 Py_INCREF(fixed_cause);
25932 PyErr_SetString(PyExc_TypeError,
25933 "exception causes must derive from "
25937 PyException_SetCause(value, fixed_cause);
25939 PyErr_SetObject(type, value);
25941 #if CYTHON_COMPILING_IN_PYPY
25942 PyObject *tmp_type, *tmp_value, *tmp_tb;
25943 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
25945 PyErr_Restore(tmp_type, tmp_value, tb);
25946 Py_XDECREF(tmp_tb);
25948 PyThreadState *tstate = __Pyx_PyThreadState_Current;
25949 PyObject* tmp_tb = tstate->curexc_traceback;
25950 if (tb != tmp_tb) {
25952 tstate->curexc_traceback = tb;
25953 Py_XDECREF(tmp_tb);
25958 Py_XDECREF(owned_instance);
25964 static CYTHON_INLINE
int __Pyx_HasAttr(PyObject *o, PyObject *
n) {
25966 if (unlikely(!__Pyx_PyBaseString_Check(
n))) {
25967 PyErr_SetString(PyExc_TypeError,
25968 "hasattr(): attribute name must be string");
25971 r = __Pyx_GetAttr(o,
n);
25972 if (unlikely(!
r)) {
25982 #if CYTHON_USE_EXC_INFO_STACK
25983 static _PyErr_StackItem *
25984 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
25986 _PyErr_StackItem *exc_info = tstate->exc_info;
25987 while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
25988 exc_info->previous_item != NULL)
25990 exc_info = exc_info->previous_item;
25997 #if CYTHON_FAST_THREAD_STATE
25998 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
25999 #if CYTHON_USE_EXC_INFO_STACK
26000 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
26001 *type = exc_info->exc_type;
26002 *value = exc_info->exc_value;
26003 *tb = exc_info->exc_traceback;
26005 *type = tstate->exc_type;
26006 *value = tstate->exc_value;
26007 *tb = tstate->exc_traceback;
26010 Py_XINCREF(*value);
26013 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
26014 PyObject *tmp_type, *tmp_value, *tmp_tb;
26015 #if CYTHON_USE_EXC_INFO_STACK
26016 _PyErr_StackItem *exc_info = tstate->exc_info;
26017 tmp_type = exc_info->exc_type;
26018 tmp_value = exc_info->exc_value;
26019 tmp_tb = exc_info->exc_traceback;
26020 exc_info->exc_type = type;
26021 exc_info->exc_value = value;
26022 exc_info->exc_traceback = tb;
26024 tmp_type = tstate->exc_type;
26025 tmp_value = tstate->exc_value;
26026 tmp_tb = tstate->exc_traceback;
26027 tstate->exc_type = type;
26028 tstate->exc_value = value;
26029 tstate->exc_traceback = tb;
26031 Py_XDECREF(tmp_type);
26032 Py_XDECREF(tmp_value);
26033 Py_XDECREF(tmp_tb);
26038 #if CYTHON_FAST_THREAD_STATE
26039 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
26041 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
26044 PyObject *local_type, *local_value, *local_tb;
26045 #if CYTHON_FAST_THREAD_STATE
26046 PyObject *tmp_type, *tmp_value, *tmp_tb;
26047 local_type = tstate->curexc_type;
26048 local_value = tstate->curexc_value;
26049 local_tb = tstate->curexc_traceback;
26050 tstate->curexc_type = 0;
26051 tstate->curexc_value = 0;
26052 tstate->curexc_traceback = 0;
26054 PyErr_Fetch(&local_type, &local_value, &local_tb);
26056 PyErr_NormalizeException(&local_type, &local_value, &local_tb);
26057 #if CYTHON_FAST_THREAD_STATE
26058 if (unlikely(tstate->curexc_type))
26060 if (unlikely(PyErr_Occurred()))
26063 #if PY_MAJOR_VERSION >= 3
26065 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
26069 Py_XINCREF(local_tb);
26070 Py_XINCREF(local_type);
26071 Py_XINCREF(local_value);
26072 *type = local_type;
26073 *value = local_value;
26075 #if CYTHON_FAST_THREAD_STATE
26076 #if CYTHON_USE_EXC_INFO_STACK
26078 _PyErr_StackItem *exc_info = tstate->exc_info;
26079 tmp_type = exc_info->exc_type;
26080 tmp_value = exc_info->exc_value;
26081 tmp_tb = exc_info->exc_traceback;
26082 exc_info->exc_type = local_type;
26083 exc_info->exc_value = local_value;
26084 exc_info->exc_traceback = local_tb;
26087 tmp_type = tstate->exc_type;
26088 tmp_value = tstate->exc_value;
26089 tmp_tb = tstate->exc_traceback;
26090 tstate->exc_type = local_type;
26091 tstate->exc_value = local_value;
26092 tstate->exc_traceback = local_tb;
26094 Py_XDECREF(tmp_type);
26095 Py_XDECREF(tmp_value);
26096 Py_XDECREF(tmp_tb);
26098 PyErr_SetExcInfo(local_type, local_value, local_tb);
26105 Py_XDECREF(local_type);
26106 Py_XDECREF(local_value);
26107 Py_XDECREF(local_tb);
26112 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type,
const char *name,
int exact)
26114 if (unlikely(!type)) {
26115 PyErr_SetString(PyExc_SystemError,
"Missing type object");
26119 #if PY_MAJOR_VERSION == 2
26120 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj)))
return 1;
26124 if (likely(__Pyx_TypeCheck(obj, type)))
return 1;
26126 PyErr_Format(PyExc_TypeError,
26127 "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
26128 name, type->tp_name, Py_TYPE(obj)->tp_name);
26133 static CYTHON_INLINE
int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2,
int equals) {
26134 #if CYTHON_COMPILING_IN_PYPY
26135 return PyObject_RichCompareBool(s1, s2, equals);
26138 return (equals == Py_EQ);
26139 }
else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
26140 const char *ps1, *ps2;
26141 Py_ssize_t length = PyBytes_GET_SIZE(s1);
26142 if (length != PyBytes_GET_SIZE(s2))
26143 return (equals == Py_NE);
26144 ps1 = PyBytes_AS_STRING(s1);
26145 ps2 = PyBytes_AS_STRING(s2);
26146 if (ps1[0] != ps2[0]) {
26147 return (equals == Py_NE);
26148 }
else if (length == 1) {
26149 return (equals == Py_EQ);
26152 #if CYTHON_USE_UNICODE_INTERNALS
26153 Py_hash_t hash1, hash2;
26154 hash1 = ((PyBytesObject*)s1)->ob_shash;
26155 hash2 = ((PyBytesObject*)s2)->ob_shash;
26156 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
26157 return (equals == Py_NE);
26160 result = memcmp(ps1, ps2, (
size_t)length);
26161 return (equals == Py_EQ) ? (result == 0) : (result != 0);
26163 }
else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
26164 return (equals == Py_NE);
26165 }
else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
26166 return (equals == Py_NE);
26169 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
26172 result = __Pyx_PyObject_IsTrue(py_result);
26173 Py_DECREF(py_result);
26180 static CYTHON_INLINE
int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2,
int equals) {
26181 #if CYTHON_COMPILING_IN_PYPY
26182 return PyObject_RichCompareBool(s1, s2, equals);
26184 #if PY_MAJOR_VERSION < 3
26185 PyObject* owned_ref = NULL;
26187 int s1_is_unicode, s2_is_unicode;
26191 s1_is_unicode = PyUnicode_CheckExact(s1);
26192 s2_is_unicode = PyUnicode_CheckExact(s2);
26193 #if PY_MAJOR_VERSION < 3
26194 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
26195 owned_ref = PyUnicode_FromObject(s2);
26196 if (unlikely(!owned_ref))
26200 }
else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
26201 owned_ref = PyUnicode_FromObject(s1);
26202 if (unlikely(!owned_ref))
26206 }
else if (((!s2_is_unicode) & (!s1_is_unicode))) {
26207 return __Pyx_PyBytes_Equals(s1, s2, equals);
26210 if (s1_is_unicode & s2_is_unicode) {
26213 void *data1, *data2;
26214 if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
26216 length = __Pyx_PyUnicode_GET_LENGTH(s1);
26217 if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
26220 #if CYTHON_USE_UNICODE_INTERNALS
26222 Py_hash_t hash1, hash2;
26223 #if CYTHON_PEP393_ENABLED
26224 hash1 = ((PyASCIIObject*)s1)->hash;
26225 hash2 = ((PyASCIIObject*)s2)->hash;
26227 hash1 = ((PyUnicodeObject*)s1)->hash;
26228 hash2 = ((PyUnicodeObject*)s2)->hash;
26230 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
26235 kind = __Pyx_PyUnicode_KIND(s1);
26236 if (kind != __Pyx_PyUnicode_KIND(s2)) {
26239 data1 = __Pyx_PyUnicode_DATA(s1);
26240 data2 = __Pyx_PyUnicode_DATA(s2);
26241 if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
26243 }
else if (length == 1) {
26246 int result = memcmp(data1, data2, (
size_t)(length * kind));
26247 #if PY_MAJOR_VERSION < 3
26248 Py_XDECREF(owned_ref);
26250 return (equals == Py_EQ) ? (result == 0) : (result != 0);
26252 }
else if ((s1 == Py_None) & s2_is_unicode) {
26254 }
else if ((s2 == Py_None) & s1_is_unicode) {
26258 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
26259 #if PY_MAJOR_VERSION < 3
26260 Py_XDECREF(owned_ref);
26264 result = __Pyx_PyObject_IsTrue(py_result);
26265 Py_DECREF(py_result);
26269 #if PY_MAJOR_VERSION < 3
26270 Py_XDECREF(owned_ref);
26272 return (equals == Py_EQ);
26274 #if PY_MAJOR_VERSION < 3
26275 Py_XDECREF(owned_ref);
26277 return (equals == Py_NE);
26282 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
26283 Py_ssize_t
q = a / b;
26284 Py_ssize_t
r = a -
q*b;
26285 q -= ((
r != 0) & ((
r ^ b) < 0));
26290 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
26291 const char* cstring, Py_ssize_t start, Py_ssize_t stop,
26292 const char* encoding,
const char* errors,
26293 PyObject* (*decode_func)(
const char *
s, Py_ssize_t size,
const char *errors)) {
26295 if (unlikely((start < 0) | (stop < 0))) {
26296 size_t slen = strlen(cstring);
26297 if (unlikely(slen > (
size_t) PY_SSIZE_T_MAX)) {
26298 PyErr_SetString(PyExc_OverflowError,
26299 "c-string too long to convert to Python");
26302 length = (Py_ssize_t) slen;
26311 if (unlikely(stop <= start))
26312 return __Pyx_NewRef(__pyx_empty_unicode);
26313 length = stop - start;
26316 return decode_func(cstring, length, errors);
26318 return PyUnicode_Decode(cstring, length, encoding, errors);
26323 static CYTHON_INLINE
void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
26324 PyErr_Format(PyExc_ValueError,
26325 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T
"d)", expected);
26329 static CYTHON_INLINE
void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
26330 PyErr_Format(PyExc_ValueError,
26331 "need more than %" CYTHON_FORMAT_SSIZE_T
"d value%.1s to unpack",
26332 index, (index == 1) ?
"" :
"s");
26336 static CYTHON_INLINE
void __Pyx_RaiseNoneNotIterableError(
void) {
26337 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not iterable");
26341 static CYTHON_INLINE
int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
26342 if (unlikely(!type)) {
26343 PyErr_SetString(PyExc_SystemError,
"Missing type object");
26346 if (likely(__Pyx_TypeCheck(obj, type)))
26348 PyErr_Format(PyExc_TypeError,
"Cannot convert %.200s to %.200s",
26349 Py_TYPE(obj)->tp_name, type->tp_name);
26354 #if CYTHON_FAST_THREAD_STATE
26355 static CYTHON_INLINE
void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
26356 PyObject *tmp_type, *tmp_value, *tmp_tb;
26357 #if CYTHON_USE_EXC_INFO_STACK
26358 _PyErr_StackItem *exc_info = tstate->exc_info;
26359 tmp_type = exc_info->exc_type;
26360 tmp_value = exc_info->exc_value;
26361 tmp_tb = exc_info->exc_traceback;
26362 exc_info->exc_type = *type;
26363 exc_info->exc_value = *value;
26364 exc_info->exc_traceback = *tb;
26366 tmp_type = tstate->exc_type;
26367 tmp_value = tstate->exc_value;
26368 tmp_tb = tstate->exc_traceback;
26369 tstate->exc_type = *type;
26370 tstate->exc_value = *value;
26371 tstate->exc_traceback = *tb;
26374 *value = tmp_value;
26378 static CYTHON_INLINE
void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
26379 PyObject *tmp_type, *tmp_value, *tmp_tb;
26380 PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
26381 PyErr_SetExcInfo(*type, *value, *tb);
26383 *value = tmp_value;
26389 #if CYTHON_COMPILING_IN_CPYTHON
26390 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
26396 return b == &PyBaseObject_Type;
26398 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
26400 if (a == b)
return 1;
26404 n = PyTuple_GET_SIZE(mro);
26405 for (i = 0; i <
n; i++) {
26406 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
26411 return __Pyx_InBases(a, b);
26413 #if PY_MAJOR_VERSION == 2
26414 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
26415 PyObject *exception, *value, *tb;
26417 __Pyx_PyThreadState_declare
26418 __Pyx_PyThreadState_assign
26419 __Pyx_ErrFetch(&exception, &value, &tb);
26420 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
26421 if (unlikely(res == -1)) {
26422 PyErr_WriteUnraisable(err);
26426 res = PyObject_IsSubclass(err, exc_type2);
26427 if (unlikely(res == -1)) {
26428 PyErr_WriteUnraisable(err);
26432 __Pyx_ErrRestore(exception, value, tb);
26436 static CYTHON_INLINE
int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
26437 int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
26439 res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
26444 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
26446 assert(PyExceptionClass_Check(exc_type));
26447 n = PyTuple_GET_SIZE(tuple);
26448 #if PY_MAJOR_VERSION >= 3
26449 for (i=0; i<
n; i++) {
26450 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
26453 for (i=0; i<
n; i++) {
26454 PyObject *t = PyTuple_GET_ITEM(tuple, i);
26455 #if PY_MAJOR_VERSION < 3
26456 if (likely(exc_type == t))
return 1;
26458 if (likely(PyExceptionClass_Check(t))) {
26459 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t))
return 1;
26465 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
26466 if (likely(err == exc_type))
return 1;
26467 if (likely(PyExceptionClass_Check(err))) {
26468 if (likely(PyExceptionClass_Check(exc_type))) {
26469 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
26470 }
else if (likely(PyTuple_Check(exc_type))) {
26471 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
26475 return PyErr_GivenExceptionMatches(err, exc_type);
26477 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
26478 assert(PyExceptionClass_Check(exc_type1));
26479 assert(PyExceptionClass_Check(exc_type2));
26480 if (likely(err == exc_type1 || err == exc_type2))
return 1;
26481 if (likely(PyExceptionClass_Check(err))) {
26482 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
26484 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
26489 #if !CYTHON_COMPILING_IN_PYPY
26490 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED
long intval,
int inplace,
int zerodivision_check) {
26492 (void)zerodivision_check;
26493 #if PY_MAJOR_VERSION < 3
26494 if (likely(PyInt_CheckExact(op1))) {
26495 const long b = intval;
26497 long a = PyInt_AS_LONG(op1);
26498 x = (long)((
unsigned long)a + b);
26499 if (likely((x^a) >= 0 || (x^b) >= 0))
26500 return PyInt_FromLong(x);
26501 return PyLong_Type.tp_as_number->nb_add(op1, op2);
26504 #if CYTHON_USE_PYLONG_INTERNALS
26505 if (likely(PyLong_CheckExact(op1))) {
26506 const long b = intval;
26508 #ifdef HAVE_LONG_LONG
26509 const PY_LONG_LONG llb = intval;
26510 PY_LONG_LONG lla, llx;
26512 const digit* digits = ((PyLongObject*)op1)->ob_digit;
26513 const Py_ssize_t size = Py_SIZE(op1);
26514 if (likely(__Pyx_sst_abs(size) <= 1)) {
26515 a = likely(size) ? digits[0] : 0;
26516 if (size == -1) a = -a;
26520 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
26521 a = -(long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
26523 #ifdef HAVE_LONG_LONG
26524 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
26525 lla = -(PY_LONG_LONG) (((((
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
26529 CYTHON_FALLTHROUGH;
26531 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
26532 a = (long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
26534 #ifdef HAVE_LONG_LONG
26535 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
26536 lla = (PY_LONG_LONG) (((((
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
26540 CYTHON_FALLTHROUGH;
26542 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
26543 a = -(long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
26545 #ifdef HAVE_LONG_LONG
26546 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
26547 lla = -(PY_LONG_LONG) (((((((
unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
26551 CYTHON_FALLTHROUGH;
26553 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
26554 a = (long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
26556 #ifdef HAVE_LONG_LONG
26557 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
26558 lla = (PY_LONG_LONG) (((((((
unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
26562 CYTHON_FALLTHROUGH;
26564 if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
26565 a = -(long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
26567 #ifdef HAVE_LONG_LONG
26568 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
26569 lla = -(PY_LONG_LONG) (((((((((
unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
26573 CYTHON_FALLTHROUGH;
26575 if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
26576 a = (long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
26578 #ifdef HAVE_LONG_LONG
26579 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
26580 lla = (PY_LONG_LONG) (((((((((
unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
26584 CYTHON_FALLTHROUGH;
26585 default:
return PyLong_Type.tp_as_number->nb_add(op1, op2);
26589 return PyLong_FromLong(x);
26590 #ifdef HAVE_LONG_LONG
26593 return PyLong_FromLongLong(llx);
26599 if (PyFloat_CheckExact(op1)) {
26600 const long b = intval;
26601 double a = PyFloat_AS_DOUBLE(op1);
26603 PyFPE_START_PROTECT(
"add",
return NULL)
26604 result = ((double)a) + (double)b;
26605 PyFPE_END_PROTECT(result)
26606 return PyFloat_FromDouble(result);
26608 return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
26613 static CYTHON_INLINE
void __Pyx_RaiseUnboundLocalError(
const char *varname) {
26614 PyErr_Format(PyExc_UnboundLocalError,
"local variable '%s' referenced before assignment", varname);
26618 static CYTHON_INLINE
long __Pyx_div_long(
long a,
long b) {
26621 q -= ((
r != 0) & ((
r ^ b) < 0));
26626 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
26627 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
26628 PyErr_Format(PyExc_AttributeError,
26629 #
if PY_MAJOR_VERSION >= 3
26630 "'%.50s' object has no attribute '%U'",
26631 tp->tp_name, attr_name);
26633 "'%.50s' object has no attribute '%.400s'",
26634 tp->tp_name, PyString_AS_STRING(attr_name));
26638 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
26640 PyTypeObject *tp = Py_TYPE(obj);
26641 if (unlikely(!PyString_Check(attr_name))) {
26642 return PyObject_GenericGetAttr(obj, attr_name);
26644 assert(!tp->tp_dictoffset);
26645 descr = _PyType_Lookup(tp, attr_name);
26646 if (unlikely(!descr)) {
26647 return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
26650 #if PY_MAJOR_VERSION < 3
26651 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
26654 descrgetfunc
f = Py_TYPE(descr)->tp_descr_get;
26656 PyObject *res =
f(descr, obj, (PyObject *)tp);
26666 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
26667 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
26668 if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
26669 return PyObject_GenericGetAttr(obj, attr_name);
26671 return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
26676 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(
void) {
26677 __Pyx_PyThreadState_declare
26678 __Pyx_PyThreadState_assign
26679 if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
26680 __Pyx_PyErr_Clear();
26682 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
26684 #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
26685 PyTypeObject* tp = Py_TYPE(obj);
26686 if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
26687 return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
26690 result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
26691 if (unlikely(!result)) {
26692 __Pyx_PyObject_GetAttrStr_ClearAttributeError();
26698 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
26700 PyObject *name_attr;
26701 name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2);
26702 if (likely(name_attr)) {
26703 ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
26707 if (unlikely(ret < 0)) {
26711 Py_XDECREF(name_attr);
26714 static int __Pyx_setup_reduce(PyObject* type_obj) {
26716 PyObject *object_reduce = NULL;
26717 PyObject *object_reduce_ex = NULL;
26718 PyObject *reduce = NULL;
26719 PyObject *reduce_ex = NULL;
26720 PyObject *reduce_cython = NULL;
26721 PyObject *setstate = NULL;
26722 PyObject *setstate_cython = NULL;
26723 #if CYTHON_USE_PYTYPE_LOOKUP
26724 if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate))
goto __PYX_GOOD;
26726 if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate))
goto __PYX_GOOD;
26728 #if CYTHON_USE_PYTYPE_LOOKUP
26729 object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex);
if (!object_reduce_ex)
goto __PYX_BAD;
26731 object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex);
if (!object_reduce_ex)
goto __PYX_BAD;
26733 reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex);
if (unlikely(!reduce_ex))
goto __PYX_BAD;
26734 if (reduce_ex == object_reduce_ex) {
26735 #if CYTHON_USE_PYTYPE_LOOKUP
26736 object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce);
if (!object_reduce)
goto __PYX_BAD;
26738 object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce);
if (!object_reduce)
goto __PYX_BAD;
26740 reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce);
if (unlikely(!reduce))
goto __PYX_BAD;
26741 if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
26742 reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython);
26743 if (likely(reduce_cython)) {
26744 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
26745 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
26746 }
else if (reduce == object_reduce || PyErr_Occurred()) {
26749 setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
26750 if (!setstate) PyErr_Clear();
26751 if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
26752 setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython);
26753 if (likely(setstate_cython)) {
26754 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
26755 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
26756 }
else if (!setstate || PyErr_Occurred()) {
26760 PyType_Modified((PyTypeObject*)type_obj);
26765 if (!PyErr_Occurred())
26766 PyErr_Format(PyExc_RuntimeError,
"Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
26769 #if !CYTHON_USE_PYTYPE_LOOKUP
26770 Py_XDECREF(object_reduce);
26771 Py_XDECREF(object_reduce_ex);
26773 Py_XDECREF(reduce);
26774 Py_XDECREF(reduce_ex);
26775 Py_XDECREF(reduce_cython);
26776 Py_XDECREF(setstate);
26777 Py_XDECREF(setstate_cython);
26782 static int __Pyx_SetVtable(PyObject *dict,
void *vtable) {
26783 #if PY_VERSION_HEX >= 0x02070000
26784 PyObject *ob = PyCapsule_New(vtable, 0, 0);
26786 PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
26790 if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
26800 #ifndef __PYX_HAVE_RT_ImportType
26801 #define __PYX_HAVE_RT_ImportType
26802 static PyTypeObject *__Pyx_ImportType(PyObject *module,
const char *module_name,
const char *class_name,
26803 size_t size,
enum __Pyx_ImportType_CheckSize check_size)
26805 PyObject *result = 0;
26807 Py_ssize_t basicsize;
26808 #ifdef Py_LIMITED_API
26809 PyObject *py_basicsize;
26811 result = PyObject_GetAttrString(module, class_name);
26814 if (!PyType_Check(result)) {
26815 PyErr_Format(PyExc_TypeError,
26816 "%.200s.%.200s is not a type object",
26817 module_name, class_name);
26820 #ifndef Py_LIMITED_API
26821 basicsize = ((PyTypeObject *)result)->tp_basicsize;
26823 py_basicsize = PyObject_GetAttrString(result,
"__basicsize__");
26826 basicsize = PyLong_AsSsize_t(py_basicsize);
26827 Py_DECREF(py_basicsize);
26829 if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
26832 if ((
size_t)basicsize < size) {
26833 PyErr_Format(PyExc_ValueError,
26834 "%.200s.%.200s size changed, may indicate binary incompatibility. "
26835 "Expected %zd from C header, got %zd from PyObject",
26836 module_name, class_name, size, basicsize);
26839 if (check_size == __Pyx_ImportType_CheckSize_Error && (
size_t)basicsize != size) {
26840 PyErr_Format(PyExc_ValueError,
26841 "%.200s.%.200s size changed, may indicate binary incompatibility. "
26842 "Expected %zd from C header, got %zd from PyObject",
26843 module_name, class_name, size, basicsize);
26846 else if (check_size == __Pyx_ImportType_CheckSize_Warn && (
size_t)basicsize > size) {
26847 PyOS_snprintf(warning,
sizeof(warning),
26848 "%s.%s size changed, may indicate binary incompatibility. "
26849 "Expected %zd from C header, got %zd from PyObject",
26850 module_name, class_name, size, basicsize);
26851 if (PyErr_WarnEx(NULL, warning, 0) < 0)
goto bad;
26853 return (PyTypeObject *)result;
26855 Py_XDECREF(result);
26861 #ifndef CYTHON_CLINE_IN_TRACEBACK
26862 static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate,
int c_line) {
26863 PyObject *use_cline;
26864 PyObject *ptype, *pvalue, *ptraceback;
26865 #if CYTHON_COMPILING_IN_CPYTHON
26866 PyObject **cython_runtime_dict;
26868 if (unlikely(!__pyx_cython_runtime)) {
26871 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
26872 #if CYTHON_COMPILING_IN_CPYTHON
26873 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
26874 if (likely(cython_runtime_dict)) {
26875 __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
26876 use_cline, *cython_runtime_dict,
26877 __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
26881 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
26882 if (use_cline_obj) {
26883 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
26884 Py_DECREF(use_cline_obj);
26892 PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
26894 else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
26897 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
26903 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line) {
26904 int start = 0, mid = 0, end = count - 1;
26905 if (end >= 0 && code_line > entries[end].code_line) {
26908 while (start < end) {
26909 mid = start + (end - start) / 2;
26910 if (code_line < entries[mid].code_line) {
26912 }
else if (code_line > entries[mid].code_line) {
26918 if (code_line <= entries[mid].code_line) {
26924 static PyCodeObject *__pyx_find_code_object(
int code_line) {
26925 PyCodeObject* code_object;
26927 if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
26930 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
26931 if (unlikely(
pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[
pos].code_line != code_line)) {
26934 code_object = __pyx_code_cache.entries[
pos].code_object;
26935 Py_INCREF(code_object);
26936 return code_object;
26938 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object) {
26940 __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
26941 if (unlikely(!code_line)) {
26944 if (unlikely(!entries)) {
26945 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*
sizeof(__Pyx_CodeObjectCacheEntry));
26946 if (likely(entries)) {
26947 __pyx_code_cache.entries = entries;
26948 __pyx_code_cache.max_count = 64;
26949 __pyx_code_cache.count = 1;
26950 entries[0].code_line = code_line;
26951 entries[0].code_object = code_object;
26952 Py_INCREF(code_object);
26956 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
26957 if ((
pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[
pos].code_line == code_line)) {
26958 PyCodeObject* tmp = entries[
pos].code_object;
26959 entries[
pos].code_object = code_object;
26963 if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
26964 int new_max = __pyx_code_cache.max_count + 64;
26965 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
26966 __pyx_code_cache.entries, ((
size_t)new_max) *
sizeof(__Pyx_CodeObjectCacheEntry));
26967 if (unlikely(!entries)) {
26970 __pyx_code_cache.entries = entries;
26971 __pyx_code_cache.max_count = new_max;
26973 for (i=__pyx_code_cache.count; i>
pos; i--) {
26974 entries[i] = entries[i-1];
26976 entries[
pos].code_line = code_line;
26977 entries[
pos].code_object = code_object;
26978 __pyx_code_cache.count++;
26979 Py_INCREF(code_object);
26983 #include "compile.h"
26984 #include "frameobject.h"
26985 #include "traceback.h"
26986 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
26987 const char *funcname,
int c_line,
26988 int py_line,
const char *filename) {
26989 PyCodeObject *py_code = 0;
26990 PyObject *py_srcfile = 0;
26991 PyObject *py_funcname = 0;
26992 #if PY_MAJOR_VERSION < 3
26993 py_srcfile = PyString_FromString(filename);
26995 py_srcfile = PyUnicode_FromString(filename);
26997 if (!py_srcfile)
goto bad;
26999 #if PY_MAJOR_VERSION < 3
27000 py_funcname = PyString_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
27002 py_funcname = PyUnicode_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
27006 #if PY_MAJOR_VERSION < 3
27007 py_funcname = PyString_FromString(funcname);
27009 py_funcname = PyUnicode_FromString(funcname);
27012 if (!py_funcname)
goto bad;
27013 py_code = __Pyx_PyCode_New(
27030 Py_DECREF(py_srcfile);
27031 Py_DECREF(py_funcname);
27034 Py_XDECREF(py_srcfile);
27035 Py_XDECREF(py_funcname);
27038 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
27039 int py_line,
const char *filename) {
27040 PyCodeObject *py_code = 0;
27041 PyFrameObject *py_frame = 0;
27042 PyThreadState *tstate = __Pyx_PyThreadState_Current;
27044 c_line = __Pyx_CLineForTraceback(tstate, c_line);
27046 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
27048 py_code = __Pyx_CreateCodeObjectForTraceback(
27049 funcname, c_line, py_line, filename);
27050 if (!py_code)
goto bad;
27051 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
27053 py_frame = PyFrame_New(
27059 if (!py_frame)
goto bad;
27060 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
27061 PyTraceBack_Here(py_frame);
27063 Py_XDECREF(py_code);
27064 Py_XDECREF(py_frame);
27067 #if PY_MAJOR_VERSION < 3
27068 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view,
int flags) {
27069 if (PyObject_CheckBuffer(obj))
return PyObject_GetBuffer(obj, view, flags);
27070 if (__Pyx_TypeCheck(obj, __pyx_array_type))
return __pyx_array_getbuffer(obj, view, flags);
27071 if (__Pyx_TypeCheck(obj, __pyx_memoryview_type))
return __pyx_memoryview_getbuffer(obj, view, flags);
27072 PyErr_Format(PyExc_TypeError,
"'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
27075 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
27076 PyObject *obj = view->obj;
27078 if (PyObject_CheckBuffer(obj)) {
27079 PyBuffer_Release(view);
27091 __pyx_memviewslice_is_contig(
const __Pyx_memviewslice mvs,
char order,
int ndim)
27093 int i, index, step, start;
27094 Py_ssize_t itemsize = mvs.memview->view.itemsize;
27095 if (order ==
'F') {
27102 for (i = 0; i < ndim; i++) {
27103 index = start + step * i;
27104 if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
27106 itemsize *= mvs.shape[index];
27113 __pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
27114 void **out_start,
void **out_end,
27115 int ndim,
size_t itemsize)
27119 start = end = slice->data;
27120 for (i = 0; i < ndim; i++) {
27121 Py_ssize_t stride = slice->strides[i];
27122 Py_ssize_t extent = slice->shape[i];
27124 *out_start = *out_end = start;
27128 end += stride * (extent - 1);
27130 start += stride * (extent - 1);
27133 *out_start = start;
27134 *out_end = end + itemsize;
27137 __pyx_slices_overlap(__Pyx_memviewslice *slice1,
27138 __Pyx_memviewslice *slice2,
27139 int ndim,
size_t itemsize)
27141 void *start1, *end1, *start2, *end2;
27142 __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
27143 __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
27144 return (start1 < end2) && (start2 < end1);
27148 static CYTHON_INLINE PyObject *
27149 __pyx_capsule_create(
void *p, CYTHON_UNUSED
const char *sig)
27152 #if PY_VERSION_HEX >= 0x02070000
27153 cobj = PyCapsule_New(p, sig, NULL);
27155 cobj = PyCObject_FromVoidPtr(p, NULL);
27161 static CYTHON_INLINE PyObject *__pyx_memview_get_double(
const char *itemp) {
27162 return (PyObject *) PyFloat_FromDouble(*(
double *) itemp);
27164 static CYTHON_INLINE
int __pyx_memview_set_double(
const char *itemp, PyObject *obj) {
27165 double value = __pyx_PyFloat_AsDouble(obj);
27166 if ((value == (
double)-1) && PyErr_Occurred())
27168 *(
double *) itemp = value;
27173 static CYTHON_INLINE
int __Pyx_Is_Little_Endian(
void)
27179 S.u32 = 0x01020304;
27180 return S.u8[0] == 4;
27184 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
27185 __Pyx_BufFmt_StackElem* stack,
27186 __Pyx_TypeInfo* type) {
27187 stack[0].field = &ctx->root;
27188 stack[0].parent_offset = 0;
27189 ctx->root.type = type;
27190 ctx->root.name =
"buffer dtype";
27191 ctx->root.offset = 0;
27193 ctx->head->field = &ctx->root;
27194 ctx->fmt_offset = 0;
27195 ctx->head->parent_offset = 0;
27196 ctx->new_packmode =
'@';
27197 ctx->enc_packmode =
'@';
27198 ctx->new_count = 1;
27199 ctx->enc_count = 0;
27201 ctx->is_complex = 0;
27202 ctx->is_valid_array = 0;
27203 ctx->struct_alignment = 0;
27204 while (type->typegroup ==
'S') {
27206 ctx->head->field = type->fields;
27207 ctx->head->parent_offset = 0;
27208 type = type->fields->type;
27211 static int __Pyx_BufFmt_ParseNumber(
const char** ts) {
27213 const char* t = *ts;
27214 if (*t < '0' || *t >
'9') {
27217 count = *t++ -
'0';
27218 while (*t >=
'0' && *t <=
'9') {
27220 count += *t++ -
'0';
27226 static int __Pyx_BufFmt_ExpectNumber(
const char **ts) {
27227 int number = __Pyx_BufFmt_ParseNumber(ts);
27229 PyErr_Format(PyExc_ValueError,\
27230 "Does not understand character buffer dtype format string ('%c')", **ts);
27233 static void __Pyx_BufFmt_RaiseUnexpectedChar(
char ch) {
27234 PyErr_Format(PyExc_ValueError,
27235 "Unexpected format string character: '%c'", ch);
27237 static const char* __Pyx_BufFmt_DescribeTypeChar(
char ch,
int is_complex) {
27239 case '?':
return "'bool'";
27240 case 'c':
return "'char'";
27241 case 'b':
return "'signed char'";
27242 case 'B':
return "'unsigned char'";
27243 case 'h':
return "'short'";
27244 case 'H':
return "'unsigned short'";
27245 case 'i':
return "'int'";
27246 case 'I':
return "'unsigned int'";
27247 case 'l':
return "'long'";
27248 case 'L':
return "'unsigned long'";
27249 case 'q':
return "'long long'";
27250 case 'Q':
return "'unsigned long long'";
27251 case 'f':
return (is_complex ?
"'complex float'" :
"'float'");
27252 case 'd':
return (is_complex ?
"'complex double'" :
"'double'");
27253 case 'g':
return (is_complex ?
"'complex long double'" :
"'long double'");
27254 case 'T':
return "a struct";
27255 case 'O':
return "Python object";
27256 case 'P':
return "a pointer";
27257 case 's':
case 'p':
return "a string";
27258 case 0:
return "end";
27259 default:
return "unparseable format string";
27262 static size_t __Pyx_BufFmt_TypeCharToStandardSize(
char ch,
int is_complex) {
27264 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
27265 case 'h':
case 'H':
return 2;
27266 case 'i':
case 'I':
case 'l':
case 'L':
return 4;
27267 case 'q':
case 'Q':
return 8;
27268 case 'f':
return (is_complex ? 8 : 4);
27269 case 'd':
return (is_complex ? 16 : 8);
27271 PyErr_SetString(PyExc_ValueError,
"Python does not define a standard format string size for long double ('g')..");
27274 case 'O':
case 'P':
return sizeof(
void*);
27276 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
27280 static size_t __Pyx_BufFmt_TypeCharToNativeSize(
char ch,
int is_complex) {
27282 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
27283 case 'h':
case 'H':
return sizeof(short);
27284 case 'i':
case 'I':
return sizeof(int);
27285 case 'l':
case 'L':
return sizeof(long);
27286 #ifdef HAVE_LONG_LONG
27287 case 'q':
case 'Q':
return sizeof(PY_LONG_LONG);
27289 case 'f':
return sizeof(float) * (is_complex ? 2 : 1);
27290 case 'd':
return sizeof(double) * (is_complex ? 2 : 1);
27291 case 'g':
return sizeof(
long double) * (is_complex ? 2 : 1);
27292 case 'O':
case 'P':
return sizeof(
void*);
27294 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
27299 typedef struct {
char c;
short x; } __Pyx_st_short;
27300 typedef struct {
char c;
int x; } __Pyx_st_int;
27301 typedef struct {
char c;
long x; } __Pyx_st_long;
27302 typedef struct {
char c;
float x; } __Pyx_st_float;
27303 typedef struct {
char c;
double x; } __Pyx_st_double;
27304 typedef struct {
char c;
long double x; } __Pyx_st_longdouble;
27305 typedef struct {
char c;
void *x; } __Pyx_st_void_p;
27306 #ifdef HAVE_LONG_LONG
27307 typedef struct {
char c; PY_LONG_LONG x; } __Pyx_st_longlong;
27309 static size_t __Pyx_BufFmt_TypeCharToAlignment(
char ch, CYTHON_UNUSED
int is_complex) {
27311 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
27312 case 'h':
case 'H':
return sizeof(__Pyx_st_short) -
sizeof(
short);
27313 case 'i':
case 'I':
return sizeof(__Pyx_st_int) -
sizeof(
int);
27314 case 'l':
case 'L':
return sizeof(__Pyx_st_long) -
sizeof(
long);
27315 #ifdef HAVE_LONG_LONG
27316 case 'q':
case 'Q':
return sizeof(__Pyx_st_longlong) -
sizeof(PY_LONG_LONG);
27318 case 'f':
return sizeof(__Pyx_st_float) -
sizeof(
float);
27319 case 'd':
return sizeof(__Pyx_st_double) -
sizeof(
double);
27320 case 'g':
return sizeof(__Pyx_st_longdouble) -
sizeof(
long double);
27321 case 'P':
case 'O':
return sizeof(__Pyx_st_void_p) -
sizeof(
void*);
27323 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
27331 typedef struct {
short x;
char c; } __Pyx_pad_short;
27332 typedef struct {
int x;
char c; } __Pyx_pad_int;
27333 typedef struct {
long x;
char c; } __Pyx_pad_long;
27334 typedef struct {
float x;
char c; } __Pyx_pad_float;
27335 typedef struct {
double x;
char c; } __Pyx_pad_double;
27336 typedef struct {
long double x;
char c; } __Pyx_pad_longdouble;
27337 typedef struct {
void *x;
char c; } __Pyx_pad_void_p;
27338 #ifdef HAVE_LONG_LONG
27339 typedef struct { PY_LONG_LONG x;
char c; } __Pyx_pad_longlong;
27341 static size_t __Pyx_BufFmt_TypeCharToPadding(
char ch, CYTHON_UNUSED
int is_complex) {
27343 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
27344 case 'h':
case 'H':
return sizeof(__Pyx_pad_short) -
sizeof(
short);
27345 case 'i':
case 'I':
return sizeof(__Pyx_pad_int) -
sizeof(
int);
27346 case 'l':
case 'L':
return sizeof(__Pyx_pad_long) -
sizeof(
long);
27347 #ifdef HAVE_LONG_LONG
27348 case 'q':
case 'Q':
return sizeof(__Pyx_pad_longlong) -
sizeof(PY_LONG_LONG);
27350 case 'f':
return sizeof(__Pyx_pad_float) -
sizeof(
float);
27351 case 'd':
return sizeof(__Pyx_pad_double) -
sizeof(
double);
27352 case 'g':
return sizeof(__Pyx_pad_longdouble) -
sizeof(
long double);
27353 case 'P':
case 'O':
return sizeof(__Pyx_pad_void_p) -
sizeof(
void*);
27355 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
27359 static char __Pyx_BufFmt_TypeCharToGroup(
char ch,
int is_complex) {
27363 case 'b':
case 'h':
case 'i':
27364 case 'l':
case 'q':
case 's':
case 'p':
27366 case '?':
case 'B':
case 'H':
case 'I':
case 'L':
case 'Q':
27368 case 'f':
case 'd':
case 'g':
27369 return (is_complex ?
'C' :
'R');
27375 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
27380 static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
27381 if (ctx->head == NULL || ctx->head->field == &ctx->root) {
27382 const char* expected;
27384 if (ctx->head == NULL) {
27388 expected = ctx->head->field->type->name;
27391 PyErr_Format(PyExc_ValueError,
27392 "Buffer dtype mismatch, expected %s%s%s but got %s",
27393 quote, expected, quote,
27394 __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
27396 __Pyx_StructField* field = ctx->head->field;
27397 __Pyx_StructField* parent = (ctx->head - 1)->field;
27398 PyErr_Format(PyExc_ValueError,
27399 "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
27400 field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
27401 parent->type->name, field->name);
27404 static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
27406 size_t size, offset, arraysize = 1;
27407 if (ctx->enc_type == 0)
return 0;
27408 if (ctx->head->field->type->arraysize[0]) {
27410 if (ctx->enc_type ==
's' || ctx->enc_type ==
'p') {
27411 ctx->is_valid_array = ctx->head->field->type->ndim == 1;
27413 if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
27414 PyErr_Format(PyExc_ValueError,
27415 "Expected a dimension of size %zu, got %zu",
27416 ctx->head->field->type->arraysize[0], ctx->enc_count);
27420 if (!ctx->is_valid_array) {
27421 PyErr_Format(PyExc_ValueError,
"Expected %d dimensions, got %d",
27422 ctx->head->field->type->ndim, ndim);
27425 for (i = 0; i < ctx->head->field->type->ndim; i++) {
27426 arraysize *= ctx->head->field->type->arraysize[i];
27428 ctx->is_valid_array = 0;
27429 ctx->enc_count = 1;
27431 group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
27433 __Pyx_StructField* field = ctx->head->field;
27434 __Pyx_TypeInfo* type = field->type;
27435 if (ctx->enc_packmode ==
'@' || ctx->enc_packmode ==
'^') {
27436 size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
27438 size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
27440 if (ctx->enc_packmode ==
'@') {
27441 size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
27442 size_t align_mod_offset;
27443 if (align_at == 0)
return -1;
27444 align_mod_offset = ctx->fmt_offset % align_at;
27445 if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
27446 if (ctx->struct_alignment == 0)
27447 ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
27450 if (type->size != size || type->typegroup != group) {
27451 if (type->typegroup ==
'C' && type->fields != NULL) {
27452 size_t parent_offset = ctx->head->parent_offset + field->offset;
27454 ctx->head->field = type->fields;
27455 ctx->head->parent_offset = parent_offset;
27458 if ((type->typegroup ==
'H' || group ==
'H') && type->size == size) {
27460 __Pyx_BufFmt_RaiseExpected(ctx);
27464 offset = ctx->head->parent_offset + field->offset;
27465 if (ctx->fmt_offset != offset) {
27466 PyErr_Format(PyExc_ValueError,
27467 "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T
"d but %" CYTHON_FORMAT_SSIZE_T
"d expected",
27468 (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
27471 ctx->fmt_offset += size;
27473 ctx->fmt_offset += (arraysize - 1) * size;
27476 if (field == &ctx->root) {
27478 if (ctx->enc_count != 0) {
27479 __Pyx_BufFmt_RaiseExpected(ctx);
27484 ctx->head->field = ++field;
27485 if (field->type == NULL) {
27487 field = ctx->head->field;
27489 }
else if (field->type->typegroup ==
'S') {
27490 size_t parent_offset = ctx->head->parent_offset + field->offset;
27491 if (field->type->fields->type == NULL)
continue;
27492 field = field->type->fields;
27494 ctx->head->field = field;
27495 ctx->head->parent_offset = parent_offset;
27501 }
while (ctx->enc_count);
27503 ctx->is_complex = 0;
27507 __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx,
const char** tsp)
27509 const char *ts = *tsp;
27510 int i = 0,
number, ndim;
27512 if (ctx->new_count != 1) {
27513 PyErr_SetString(PyExc_ValueError,
27514 "Cannot handle repeated arrays in format string");
27517 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
27518 ndim = ctx->head->field->type->ndim;
27519 while (*ts && *ts !=
')') {
27521 case ' ':
case '\f':
case '\r':
case '\n':
case '\t':
case '\v':
continue;
27524 number = __Pyx_BufFmt_ExpectNumber(&ts);
27525 if (
number == -1)
return NULL;
27526 if (i < ndim && (
size_t)
number != ctx->head->field->type->arraysize[i])
27527 return PyErr_Format(PyExc_ValueError,
27528 "Expected a dimension of size %zu, got %d",
27529 ctx->head->field->type->arraysize[i],
number);
27530 if (*ts !=
',' && *ts !=
')')
27531 return PyErr_Format(PyExc_ValueError,
27532 "Expected a comma in format string, got '%c'", *ts);
27533 if (*ts ==
',') ts++;
27537 return PyErr_Format(PyExc_ValueError,
"Expected %d dimension(s), got %d",
27538 ctx->head->field->type->ndim, i);
27540 PyErr_SetString(PyExc_ValueError,
27541 "Unexpected end of format string, expected ')'");
27544 ctx->is_valid_array = 1;
27545 ctx->new_count = 1;
27549 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx,
const char* ts) {
27554 if (ctx->enc_type != 0 && ctx->head == NULL) {
27555 __Pyx_BufFmt_RaiseExpected(ctx);
27558 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
27559 if (ctx->head != NULL) {
27560 __Pyx_BufFmt_RaiseExpected(ctx);
27570 if (!__Pyx_Is_Little_Endian()) {
27571 PyErr_SetString(PyExc_ValueError,
"Little-endian buffer not supported on big-endian compiler");
27574 ctx->new_packmode =
'=';
27579 if (__Pyx_Is_Little_Endian()) {
27580 PyErr_SetString(PyExc_ValueError,
"Big-endian buffer not supported on little-endian compiler");
27583 ctx->new_packmode =
'=';
27589 ctx->new_packmode = *ts++;
27593 const char* ts_after_sub;
27594 size_t i, struct_count = ctx->new_count;
27595 size_t struct_alignment = ctx->struct_alignment;
27596 ctx->new_count = 1;
27599 PyErr_SetString(PyExc_ValueError,
"Buffer acquisition: Expected '{' after 'T'");
27602 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
27604 ctx->enc_count = 0;
27605 ctx->struct_alignment = 0;
27608 for (i = 0; i != struct_count; ++i) {
27609 ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
27610 if (!ts_after_sub)
return NULL;
27613 if (struct_alignment) ctx->struct_alignment = struct_alignment;
27618 size_t alignment = ctx->struct_alignment;
27620 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
27622 if (alignment && ctx->fmt_offset % alignment) {
27623 ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
27628 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
27629 ctx->fmt_offset += ctx->new_count;
27630 ctx->new_count = 1;
27631 ctx->enc_count = 0;
27633 ctx->enc_packmode = ctx->new_packmode;
27639 if (*ts !=
'f' && *ts !=
'd' && *ts !=
'g') {
27640 __Pyx_BufFmt_RaiseUnexpectedChar(
'Z');
27643 CYTHON_FALLTHROUGH;
27644 case '?':
case 'c':
case 'b':
case 'B':
case 'h':
case 'H':
case 'i':
case 'I':
27645 case 'l':
case 'L':
case 'q':
case 'Q':
27646 case 'f':
case 'd':
case 'g':
27647 case 'O':
case 'p':
27648 if ((ctx->enc_type == *ts) && (got_Z == ctx->is_complex) &&
27649 (ctx->enc_packmode == ctx->new_packmode) && (!ctx->is_valid_array)) {
27650 ctx->enc_count += ctx->new_count;
27651 ctx->new_count = 1;
27656 CYTHON_FALLTHROUGH;
27658 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
27659 ctx->enc_count = ctx->new_count;
27660 ctx->enc_packmode = ctx->new_packmode;
27661 ctx->enc_type = *ts;
27662 ctx->is_complex = got_Z;
27664 ctx->new_count = 1;
27669 while(*ts !=
':') ++ts;
27673 if (!__pyx_buffmt_parse_array(ctx, &ts))
return NULL;
27677 int number = __Pyx_BufFmt_ExpectNumber(&ts);
27678 if (
number == -1)
return NULL;
27679 ctx->new_count = (size_t)
number;
27687 __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
27694 if (a->size != b->size || a->typegroup != b->typegroup ||
27695 a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) {
27696 if (a->typegroup ==
'H' || b->typegroup ==
'H') {
27697 return a->size == b->size;
27703 for (i = 0; i < a->ndim; i++)
27704 if (a->arraysize[i] != b->arraysize[i])
27707 if (a->typegroup ==
'S') {
27708 if (a->flags != b->flags)
27710 if (a->fields || b->fields) {
27711 if (!(a->fields && b->fields))
27713 for (i = 0; a->fields[i].type && b->fields[i].type; i++) {
27714 __Pyx_StructField *field_a = a->fields + i;
27715 __Pyx_StructField *field_b = b->fields + i;
27716 if (field_a->offset != field_b->offset ||
27717 !__pyx_typeinfo_cmp(field_a->type, field_b->type))
27720 return !a->fields[i].type && !b->fields[i].type;
27728 __pyx_check_strides(Py_buffer *buf,
int dim,
int ndim,
int spec)
27730 if (buf->shape[dim] <= 1)
27732 if (buf->strides) {
27733 if (spec & __Pyx_MEMVIEW_CONTIG) {
27734 if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) {
27735 if (unlikely(buf->strides[dim] !=
sizeof(
void *))) {
27736 PyErr_Format(PyExc_ValueError,
27737 "Buffer is not indirectly contiguous "
27738 "in dimension %d.", dim);
27741 }
else if (unlikely(buf->strides[dim] != buf->itemsize)) {
27742 PyErr_SetString(PyExc_ValueError,
27743 "Buffer and memoryview are not contiguous "
27744 "in the same dimension.");
27748 if (spec & __Pyx_MEMVIEW_FOLLOW) {
27749 Py_ssize_t stride = buf->strides[dim];
27752 if (unlikely(stride < buf->itemsize)) {
27753 PyErr_SetString(PyExc_ValueError,
27754 "Buffer and memoryview are not contiguous "
27755 "in the same dimension.");
27760 if (unlikely(spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1)) {
27761 PyErr_Format(PyExc_ValueError,
27762 "C-contiguous buffer is not contiguous in "
27763 "dimension %d", dim);
27765 }
else if (unlikely(spec & (__Pyx_MEMVIEW_PTR))) {
27766 PyErr_Format(PyExc_ValueError,
27767 "C-contiguous buffer is not indirect in "
27768 "dimension %d", dim);
27770 }
else if (unlikely(buf->suboffsets)) {
27771 PyErr_SetString(PyExc_ValueError,
27772 "Buffer exposes suboffsets but no strides");
27781 __pyx_check_suboffsets(Py_buffer *buf,
int dim, CYTHON_UNUSED
int ndim,
int spec)
27783 if (spec & __Pyx_MEMVIEW_DIRECT) {
27784 if (unlikely(buf->suboffsets && buf->suboffsets[dim] >= 0)) {
27785 PyErr_Format(PyExc_ValueError,
27786 "Buffer not compatible with direct access "
27787 "in dimension %d.", dim);
27791 if (spec & __Pyx_MEMVIEW_PTR) {
27792 if (unlikely(!buf->suboffsets || (buf->suboffsets[dim] < 0))) {
27793 PyErr_Format(PyExc_ValueError,
27794 "Buffer is not indirectly accessible "
27795 "in dimension %d.", dim);
27804 __pyx_verify_contig(Py_buffer *buf,
int ndim,
int c_or_f_flag)
27807 if (c_or_f_flag & __Pyx_IS_F_CONTIG) {
27808 Py_ssize_t stride = 1;
27809 for (i = 0; i < ndim; i++) {
27810 if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) {
27811 PyErr_SetString(PyExc_ValueError,
27812 "Buffer not fortran contiguous.");
27815 stride = stride * buf->shape[i];
27817 }
else if (c_or_f_flag & __Pyx_IS_C_CONTIG) {
27818 Py_ssize_t stride = 1;
27819 for (i = ndim - 1; i >- 1; i--) {
27820 if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) {
27821 PyErr_SetString(PyExc_ValueError,
27822 "Buffer not C contiguous.");
27825 stride = stride * buf->shape[i];
27832 static int __Pyx_ValidateAndInit_memviewslice(
27837 __Pyx_TypeInfo *dtype,
27838 __Pyx_BufFmt_StackElem stack[],
27839 __Pyx_memviewslice *memviewslice,
27840 PyObject *original_obj)
27842 struct __pyx_memoryview_obj *memview, *new_memview;
27843 __Pyx_RefNannyDeclarations
27845 int i, spec = 0, retval = -1;
27846 __Pyx_BufFmt_Context ctx;
27847 int from_memoryview = __pyx_memoryview_check(original_obj);
27848 __Pyx_RefNannySetupContext(
"ValidateAndInit_memviewslice", 0);
27849 if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((
struct __pyx_memoryview_obj *)
27850 original_obj)->typeinfo)) {
27851 memview = (
struct __pyx_memoryview_obj *) original_obj;
27852 new_memview = NULL;
27854 memview = (
struct __pyx_memoryview_obj *) __pyx_memoryview_new(
27855 original_obj, buf_flags, 0, dtype);
27856 new_memview = memview;
27857 if (unlikely(!memview))
27860 buf = &memview->view;
27861 if (unlikely(buf->ndim != ndim)) {
27862 PyErr_Format(PyExc_ValueError,
27863 "Buffer has wrong number of dimensions (expected %d, got %d)",
27868 __Pyx_BufFmt_Init(&ctx, stack, dtype);
27869 if (unlikely(!__Pyx_BufFmt_CheckString(&ctx, buf->format)))
goto fail;
27871 if (unlikely((
unsigned) buf->itemsize != dtype->size)) {
27872 PyErr_Format(PyExc_ValueError,
27873 "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T
"u byte%s) "
27874 "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T
"u byte%s)",
27876 (buf->itemsize > 1) ?
"s" :
"",
27879 (dtype->size > 1) ?
"s" :
"");
27882 if (buf->len > 0) {
27883 for (i = 0; i < ndim; i++) {
27884 spec = axes_specs[i];
27885 if (unlikely(!__pyx_check_strides(buf, i, ndim, spec)))
27887 if (unlikely(!__pyx_check_suboffsets(buf, i, ndim, spec)))
27890 if (unlikely(buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag)))
27893 if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice,
27894 new_memview != NULL) == -1)) {
27900 Py_XDECREF(new_memview);
27903 __Pyx_RefNannyFinishContext();
27908 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *obj,
int writable_flag) {
27909 __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
27910 __Pyx_BufFmt_StackElem stack[1];
27911 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
27913 if (obj == Py_None) {
27914 result.memview = (
struct __pyx_memoryview_obj *) Py_None;
27917 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
27918 PyBUF_RECORDS_RO | writable_flag, 1,
27919 &__Pyx_TypeInfo_double, stack,
27921 if (unlikely(retcode == -1))
27925 result.memview = NULL;
27926 result.data = NULL;
27931 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
27932 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
27933 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
27934 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
27935 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
27937 func_type value = func_value;\
27938 if (sizeof(target_type) < sizeof(func_type)) {\
27939 if (unlikely(value != (func_type) (target_type) value)) {\
27940 func_type zero = 0;\
27941 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
27942 return (target_type) -1;\
27943 if (is_unsigned && unlikely(value < zero))\
27944 goto raise_neg_overflow;\
27946 goto raise_overflow;\
27949 return (target_type) value;\
27953 #if CYTHON_CCOMPLEX
27955 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
27956 return ::std::complex< float >(x, y);
27959 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
27960 return x + y*(__pyx_t_float_complex)_Complex_I;
27964 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
27965 __pyx_t_float_complex
z;
27973 #if CYTHON_CCOMPLEX
27975 static CYTHON_INLINE
int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27976 return (a.real == b.real) && (a.imag == b.imag);
27978 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27979 __pyx_t_float_complex
z;
27980 z.real = a.real + b.real;
27981 z.imag = a.imag + b.imag;
27984 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27985 __pyx_t_float_complex
z;
27986 z.real = a.real - b.real;
27987 z.imag = a.imag - b.imag;
27990 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27991 __pyx_t_float_complex
z;
27992 z.real = a.real * b.real - a.imag * b.imag;
27993 z.imag = a.real * b.imag + a.imag * b.real;
27997 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27999 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
28000 }
else if (fabsf(b.real) >= fabsf(b.imag)) {
28001 if (b.real == 0 && b.imag == 0) {
28002 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
28004 float r = b.imag / b.real;
28005 float s = (float)(1.0) / (b.real + b.imag *
r);
28006 return __pyx_t_float_complex_from_parts(
28007 (a.real + a.imag *
r) *
s, (a.imag - a.real *
r) *
s);
28010 float r = b.real / b.imag;
28011 float s = (float)(1.0) / (b.imag + b.real *
r);
28012 return __pyx_t_float_complex_from_parts(
28013 (a.real *
r + a.imag) *
s, (a.imag *
r - a.real) *
s);
28017 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
28019 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
28021 float denom = b.real * b.real + b.imag * b.imag;
28022 return __pyx_t_float_complex_from_parts(
28023 (a.real * b.real + a.imag * b.imag) / denom,
28024 (a.imag * b.real - a.real * b.imag) / denom);
28028 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
28029 __pyx_t_float_complex
z;
28034 static CYTHON_INLINE
int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
28035 return (a.real == 0) && (a.imag == 0);
28037 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
28038 __pyx_t_float_complex
z;
28044 static CYTHON_INLINE
float __Pyx_c_abs_float(__pyx_t_float_complex
z) {
28045 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
28046 return sqrtf(
z.real*
z.real +
z.imag*
z.imag);
28048 return hypotf(
z.real,
z.imag);
28051 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
28052 __pyx_t_float_complex
z;
28053 float r, lnr, theta, z_r, z_theta;
28054 if (b.imag == 0 && b.real == (
int)b.real) {
28056 float denom = a.real * a.real + a.imag * a.imag;
28057 a.real = a.real / denom;
28058 a.imag = -a.imag / denom;
28061 switch ((
int)b.real) {
28069 return __Pyx_c_prod_float(a, a);
28071 z = __Pyx_c_prod_float(a, a);
28072 return __Pyx_c_prod_float(
z, a);
28074 z = __Pyx_c_prod_float(a, a);
28075 return __Pyx_c_prod_float(
z,
z);
28081 }
else if (b.imag == 0) {
28082 z.real = powf(a.real, b.real);
28085 }
else if (a.real > 0) {
28090 theta = atan2f(0.0, -1.0);
28093 r = __Pyx_c_abs_float(a);
28094 theta = atan2f(a.imag, a.real);
28097 z_r = expf(lnr * b.real - theta * b.imag);
28098 z_theta = theta * b.real + lnr * b.imag;
28099 z.real = z_r * cosf(z_theta);
28100 z.imag = z_r * sinf(z_theta);
28107 #if CYTHON_CCOMPLEX
28109 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
28110 return ::std::complex< double >(x, y);
28113 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
28114 return x + y*(__pyx_t_double_complex)_Complex_I;
28118 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
28119 __pyx_t_double_complex
z;
28127 #if CYTHON_CCOMPLEX
28129 static CYTHON_INLINE
int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
28130 return (a.real == b.real) && (a.imag == b.imag);
28132 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
28133 __pyx_t_double_complex
z;
28134 z.real = a.real + b.real;
28135 z.imag = a.imag + b.imag;
28138 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
28139 __pyx_t_double_complex
z;
28140 z.real = a.real - b.real;
28141 z.imag = a.imag - b.imag;
28144 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
28145 __pyx_t_double_complex
z;
28146 z.real = a.real * b.real - a.imag * b.imag;
28147 z.imag = a.real * b.imag + a.imag * b.real;
28151 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
28153 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
28154 }
else if (fabs(b.real) >= fabs(b.imag)) {
28155 if (b.real == 0 && b.imag == 0) {
28156 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
28158 double r = b.imag / b.real;
28159 double s = (double)(1.0) / (b.real + b.imag *
r);
28160 return __pyx_t_double_complex_from_parts(
28161 (a.real + a.imag *
r) *
s, (a.imag - a.real *
r) *
s);
28164 double r = b.real / b.imag;
28165 double s = (double)(1.0) / (b.imag + b.real *
r);
28166 return __pyx_t_double_complex_from_parts(
28167 (a.real *
r + a.imag) *
s, (a.imag *
r - a.real) *
s);
28171 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
28173 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
28175 double denom = b.real * b.real + b.imag * b.imag;
28176 return __pyx_t_double_complex_from_parts(
28177 (a.real * b.real + a.imag * b.imag) / denom,
28178 (a.imag * b.real - a.real * b.imag) / denom);
28182 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
28183 __pyx_t_double_complex
z;
28188 static CYTHON_INLINE
int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
28189 return (a.real == 0) && (a.imag == 0);
28191 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
28192 __pyx_t_double_complex
z;
28198 static CYTHON_INLINE
double __Pyx_c_abs_double(__pyx_t_double_complex
z) {
28199 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
28200 return sqrt(
z.real*
z.real +
z.imag*
z.imag);
28202 return hypot(
z.real,
z.imag);
28205 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
28206 __pyx_t_double_complex
z;
28207 double r, lnr, theta, z_r, z_theta;
28208 if (b.imag == 0 && b.real == (
int)b.real) {
28210 double denom = a.real * a.real + a.imag * a.imag;
28211 a.real = a.real / denom;
28212 a.imag = -a.imag / denom;
28215 switch ((
int)b.real) {
28223 return __Pyx_c_prod_double(a, a);
28225 z = __Pyx_c_prod_double(a, a);
28226 return __Pyx_c_prod_double(
z, a);
28228 z = __Pyx_c_prod_double(a, a);
28229 return __Pyx_c_prod_double(
z,
z);
28235 }
else if (b.imag == 0) {
28236 z.real = pow(a.real, b.real);
28239 }
else if (a.real > 0) {
28244 theta = atan2(0.0, -1.0);
28247 r = __Pyx_c_abs_double(a);
28248 theta = atan2(a.imag, a.real);
28251 z_r = exp(lnr * b.real - theta * b.imag);
28252 z_theta = theta * b.real + lnr * b.imag;
28253 z.real = z_r * cos(z_theta);
28254 z.imag = z_r * sin(z_theta);
28261 static __Pyx_memviewslice
28262 __pyx_memoryview_copy_new_contig(
const __Pyx_memviewslice *from_mvs,
28263 const char *mode,
int ndim,
28264 size_t sizeof_dtype,
int contig_flag,
28265 int dtype_is_object)
28267 __Pyx_RefNannyDeclarations
28269 __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } };
28270 struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
28271 Py_buffer *buf = &from_memview->view;
28272 PyObject *shape_tuple = NULL;
28273 PyObject *temp_int = NULL;
28274 struct __pyx_array_obj *array_obj = NULL;
28275 struct __pyx_memoryview_obj *memview_obj = NULL;
28276 __Pyx_RefNannySetupContext(
"__pyx_memoryview_copy_new_contig", 0);
28277 for (i = 0; i < ndim; i++) {
28278 if (unlikely(from_mvs->suboffsets[i] >= 0)) {
28279 PyErr_Format(PyExc_ValueError,
"Cannot copy memoryview slice with "
28280 "indirect dimensions (axis %d)", i);
28284 shape_tuple = PyTuple_New(ndim);
28285 if (unlikely(!shape_tuple)) {
28288 __Pyx_GOTREF(shape_tuple);
28289 for(i = 0; i < ndim; i++) {
28290 temp_int = PyInt_FromSsize_t(from_mvs->shape[i]);
28291 if(unlikely(!temp_int)) {
28294 PyTuple_SET_ITEM(shape_tuple, i, temp_int);
28298 array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (
char *) mode, NULL);
28299 if (unlikely(!array_obj)) {
28302 __Pyx_GOTREF(array_obj);
28303 memview_obj = (
struct __pyx_memoryview_obj *) __pyx_memoryview_new(
28304 (PyObject *) array_obj, contig_flag,
28306 from_mvs->memview->typeinfo);
28307 if (unlikely(!memview_obj))
28309 if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
28311 if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
28312 dtype_is_object) < 0))
28316 __Pyx_XDECREF(new_mvs.memview);
28317 new_mvs.memview = NULL;
28318 new_mvs.data = NULL;
28320 __Pyx_XDECREF(shape_tuple);
28321 __Pyx_XDECREF(temp_int);
28322 __Pyx_XDECREF(array_obj);
28323 __Pyx_RefNannyFinishContext();
28328 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value) {
28329 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28330 #pragma GCC diagnostic push
28331 #pragma GCC diagnostic ignored "-Wconversion"
28333 const int neg_one = (int) -1, const_zero = (
int) 0;
28334 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28335 #pragma GCC diagnostic pop
28337 const int is_unsigned = neg_one > const_zero;
28339 if (
sizeof(
int) <
sizeof(long)) {
28340 return PyInt_FromLong((
long) value);
28341 }
else if (
sizeof(
int) <=
sizeof(
unsigned long)) {
28342 return PyLong_FromUnsignedLong((
unsigned long) value);
28343 #ifdef HAVE_LONG_LONG
28344 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
28345 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
28349 if (
sizeof(
int) <=
sizeof(
long)) {
28350 return PyInt_FromLong((
long) value);
28351 #ifdef HAVE_LONG_LONG
28352 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
28353 return PyLong_FromLongLong((PY_LONG_LONG) value);
28358 int one = 1;
int little = (int)*(
unsigned char *)&one;
28359 unsigned char *bytes = (
unsigned char *)&value;
28360 return _PyLong_FromByteArray(bytes,
sizeof(
int),
28361 little, !is_unsigned);
28366 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *x) {
28367 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28368 #pragma GCC diagnostic push
28369 #pragma GCC diagnostic ignored "-Wconversion"
28371 const int neg_one = (int) -1, const_zero = (
int) 0;
28372 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28373 #pragma GCC diagnostic pop
28375 const int is_unsigned = neg_one > const_zero;
28376 #if PY_MAJOR_VERSION < 3
28377 if (likely(PyInt_Check(x))) {
28378 if (
sizeof(
int) <
sizeof(long)) {
28379 __PYX_VERIFY_RETURN_INT(
int,
long, PyInt_AS_LONG(x))
28381 long val = PyInt_AS_LONG(x);
28382 if (is_unsigned && unlikely(val < 0)) {
28383 goto raise_neg_overflow;
28389 if (likely(PyLong_Check(x))) {
28391 #if CYTHON_USE_PYLONG_INTERNALS
28392 const digit* digits = ((PyLongObject*)x)->ob_digit;
28393 switch (Py_SIZE(x)) {
28394 case 0:
return (
int) 0;
28395 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, digits[0])
28397 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
28398 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28399 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28400 }
else if (8 *
sizeof(
int) >= 2 * PyLong_SHIFT) {
28401 return (
int) (((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
28406 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
28407 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28408 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28409 }
else if (8 *
sizeof(
int) >= 3 * PyLong_SHIFT) {
28410 return (
int) (((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
28415 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
28416 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28417 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28418 }
else if (8 *
sizeof(
int) >= 4 * PyLong_SHIFT) {
28419 return (
int) (((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
28425 #if CYTHON_COMPILING_IN_CPYTHON
28426 if (unlikely(Py_SIZE(x) < 0)) {
28427 goto raise_neg_overflow;
28431 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
28432 if (unlikely(result < 0))
28434 if (unlikely(result == 1))
28435 goto raise_neg_overflow;
28438 if (
sizeof(
int) <=
sizeof(
unsigned long)) {
28439 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned long, PyLong_AsUnsignedLong(x))
28440 #ifdef HAVE_LONG_LONG
28441 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
28442 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
28446 #if CYTHON_USE_PYLONG_INTERNALS
28447 const digit* digits = ((PyLongObject*)x)->ob_digit;
28448 switch (Py_SIZE(x)) {
28449 case 0:
return (
int) 0;
28450 case -1: __PYX_VERIFY_RETURN_INT(
int, sdigit, (sdigit) (-(sdigit)digits[0]))
28451 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, +digits[0])
28453 if (8 *
sizeof(
int) - 1 > 1 * PyLong_SHIFT) {
28454 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28455 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28456 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
28457 return (
int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
28462 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
28463 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28464 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28465 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
28466 return (
int) ((((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
28471 if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
28472 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28473 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28474 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
28475 return (
int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
28480 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
28481 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28482 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28483 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
28484 return (
int) ((((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
28489 if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
28490 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28491 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28492 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
28493 return (
int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
28498 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
28499 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28500 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28501 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
28502 return (
int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
28508 if (
sizeof(
int) <=
sizeof(long)) {
28509 __PYX_VERIFY_RETURN_INT_EXC(
int,
long, PyLong_AsLong(x))
28510 #ifdef HAVE_LONG_LONG
28511 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
28512 __PYX_VERIFY_RETURN_INT_EXC(
int, PY_LONG_LONG, PyLong_AsLongLong(x))
28517 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
28518 PyErr_SetString(PyExc_RuntimeError,
28519 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
28522 PyObject *
v = __Pyx_PyNumber_IntOrLong(x);
28523 #if PY_MAJOR_VERSION < 3
28524 if (likely(
v) && !PyLong_Check(
v)) {
28526 v = PyNumber_Long(tmp);
28531 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
28532 unsigned char *bytes = (
unsigned char *)&val;
28533 int ret = _PyLong_AsByteArray((PyLongObject *)
v,
28534 bytes,
sizeof(val),
28535 is_little, !is_unsigned);
28545 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
28546 if (!tmp)
return (
int) -1;
28547 val = __Pyx_PyInt_As_int(tmp);
28552 PyErr_SetString(PyExc_OverflowError,
28553 "value too large to convert to int");
28555 raise_neg_overflow:
28556 PyErr_SetString(PyExc_OverflowError,
28557 "can't convert negative value to int");
28562 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *x) {
28563 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28564 #pragma GCC diagnostic push
28565 #pragma GCC diagnostic ignored "-Wconversion"
28567 const long neg_one = (long) -1, const_zero = (
long) 0;
28568 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28569 #pragma GCC diagnostic pop
28571 const int is_unsigned = neg_one > const_zero;
28572 #if PY_MAJOR_VERSION < 3
28573 if (likely(PyInt_Check(x))) {
28574 if (
sizeof(
long) <
sizeof(long)) {
28575 __PYX_VERIFY_RETURN_INT(
long,
long, PyInt_AS_LONG(x))
28577 long val = PyInt_AS_LONG(x);
28578 if (is_unsigned && unlikely(val < 0)) {
28579 goto raise_neg_overflow;
28585 if (likely(PyLong_Check(x))) {
28587 #if CYTHON_USE_PYLONG_INTERNALS
28588 const digit* digits = ((PyLongObject*)x)->ob_digit;
28589 switch (Py_SIZE(x)) {
28590 case 0:
return (
long) 0;
28591 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, digits[0])
28593 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
28594 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28595 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28596 }
else if (8 *
sizeof(
long) >= 2 * PyLong_SHIFT) {
28597 return (
long) (((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
28602 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
28603 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28604 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28605 }
else if (8 *
sizeof(
long) >= 3 * PyLong_SHIFT) {
28606 return (
long) (((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
28611 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
28612 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28613 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28614 }
else if (8 *
sizeof(
long) >= 4 * PyLong_SHIFT) {
28615 return (
long) (((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
28621 #if CYTHON_COMPILING_IN_CPYTHON
28622 if (unlikely(Py_SIZE(x) < 0)) {
28623 goto raise_neg_overflow;
28627 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
28628 if (unlikely(result < 0))
28630 if (unlikely(result == 1))
28631 goto raise_neg_overflow;
28634 if (
sizeof(
long) <=
sizeof(
unsigned long)) {
28635 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned long, PyLong_AsUnsignedLong(x))
28636 #ifdef HAVE_LONG_LONG
28637 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
28638 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
28642 #if CYTHON_USE_PYLONG_INTERNALS
28643 const digit* digits = ((PyLongObject*)x)->ob_digit;
28644 switch (Py_SIZE(x)) {
28645 case 0:
return (
long) 0;
28646 case -1: __PYX_VERIFY_RETURN_INT(
long, sdigit, (sdigit) (-(sdigit)digits[0]))
28647 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, +digits[0])
28649 if (8 *
sizeof(
long) - 1 > 1 * PyLong_SHIFT) {
28650 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28651 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28652 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
28653 return (
long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
28658 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
28659 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28660 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28661 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
28662 return (
long) ((((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
28667 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
28668 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28669 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28670 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
28671 return (
long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28676 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
28677 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28678 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28679 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
28680 return (
long) ((((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28685 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
28686 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28687 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28688 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
28689 return (
long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
28694 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
28695 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28696 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28697 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
28698 return (
long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
28704 if (
sizeof(
long) <=
sizeof(long)) {
28705 __PYX_VERIFY_RETURN_INT_EXC(
long,
long, PyLong_AsLong(x))
28706 #ifdef HAVE_LONG_LONG
28707 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
28708 __PYX_VERIFY_RETURN_INT_EXC(
long, PY_LONG_LONG, PyLong_AsLongLong(x))
28713 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
28714 PyErr_SetString(PyExc_RuntimeError,
28715 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
28718 PyObject *
v = __Pyx_PyNumber_IntOrLong(x);
28719 #if PY_MAJOR_VERSION < 3
28720 if (likely(
v) && !PyLong_Check(
v)) {
28722 v = PyNumber_Long(tmp);
28727 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
28728 unsigned char *bytes = (
unsigned char *)&val;
28729 int ret = _PyLong_AsByteArray((PyLongObject *)
v,
28730 bytes,
sizeof(val),
28731 is_little, !is_unsigned);
28741 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
28742 if (!tmp)
return (
long) -1;
28743 val = __Pyx_PyInt_As_long(tmp);
28748 PyErr_SetString(PyExc_OverflowError,
28749 "value too large to convert to long");
28751 raise_neg_overflow:
28752 PyErr_SetString(PyExc_OverflowError,
28753 "can't convert negative value to long");
28758 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value) {
28759 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28760 #pragma GCC diagnostic push
28761 #pragma GCC diagnostic ignored "-Wconversion"
28763 const long neg_one = (long) -1, const_zero = (
long) 0;
28764 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28765 #pragma GCC diagnostic pop
28767 const int is_unsigned = neg_one > const_zero;
28769 if (
sizeof(
long) <
sizeof(long)) {
28770 return PyInt_FromLong((
long) value);
28771 }
else if (
sizeof(
long) <=
sizeof(
unsigned long)) {
28772 return PyLong_FromUnsignedLong((
unsigned long) value);
28773 #ifdef HAVE_LONG_LONG
28774 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
28775 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
28779 if (
sizeof(
long) <=
sizeof(
long)) {
28780 return PyInt_FromLong((
long) value);
28781 #ifdef HAVE_LONG_LONG
28782 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
28783 return PyLong_FromLongLong((PY_LONG_LONG) value);
28788 int one = 1;
int little = (int)*(
unsigned char *)&one;
28789 unsigned char *bytes = (
unsigned char *)&value;
28790 return _PyLong_FromByteArray(bytes,
sizeof(
long),
28791 little, !is_unsigned);
28796 static CYTHON_INLINE
char __Pyx_PyInt_As_char(PyObject *x) {
28797 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28798 #pragma GCC diagnostic push
28799 #pragma GCC diagnostic ignored "-Wconversion"
28801 const char neg_one = (char) -1, const_zero = (
char) 0;
28802 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28803 #pragma GCC diagnostic pop
28805 const int is_unsigned = neg_one > const_zero;
28806 #if PY_MAJOR_VERSION < 3
28807 if (likely(PyInt_Check(x))) {
28808 if (
sizeof(
char) <
sizeof(long)) {
28809 __PYX_VERIFY_RETURN_INT(
char,
long, PyInt_AS_LONG(x))
28811 long val = PyInt_AS_LONG(x);
28812 if (is_unsigned && unlikely(val < 0)) {
28813 goto raise_neg_overflow;
28819 if (likely(PyLong_Check(x))) {
28821 #if CYTHON_USE_PYLONG_INTERNALS
28822 const digit* digits = ((PyLongObject*)x)->ob_digit;
28823 switch (Py_SIZE(x)) {
28824 case 0:
return (
char) 0;
28825 case 1: __PYX_VERIFY_RETURN_INT(
char, digit, digits[0])
28827 if (8 *
sizeof(
char) > 1 * PyLong_SHIFT) {
28828 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28829 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28830 }
else if (8 *
sizeof(
char) >= 2 * PyLong_SHIFT) {
28831 return (
char) (((((char)digits[1]) << PyLong_SHIFT) | (
char)digits[0]));
28836 if (8 *
sizeof(
char) > 2 * PyLong_SHIFT) {
28837 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28838 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28839 }
else if (8 *
sizeof(
char) >= 3 * PyLong_SHIFT) {
28840 return (
char) (((((((char)digits[2]) << PyLong_SHIFT) | (
char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
28845 if (8 *
sizeof(
char) > 3 * PyLong_SHIFT) {
28846 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28847 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28848 }
else if (8 *
sizeof(
char) >= 4 * PyLong_SHIFT) {
28849 return (
char) (((((((((char)digits[3]) << PyLong_SHIFT) | (
char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (
char)digits[0]));
28855 #if CYTHON_COMPILING_IN_CPYTHON
28856 if (unlikely(Py_SIZE(x) < 0)) {
28857 goto raise_neg_overflow;
28861 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
28862 if (unlikely(result < 0))
28864 if (unlikely(result == 1))
28865 goto raise_neg_overflow;
28868 if (
sizeof(
char) <=
sizeof(
unsigned long)) {
28869 __PYX_VERIFY_RETURN_INT_EXC(
char,
unsigned long, PyLong_AsUnsignedLong(x))
28870 #ifdef HAVE_LONG_LONG
28871 }
else if (
sizeof(
char) <=
sizeof(
unsigned PY_LONG_LONG)) {
28872 __PYX_VERIFY_RETURN_INT_EXC(
char,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
28876 #if CYTHON_USE_PYLONG_INTERNALS
28877 const digit* digits = ((PyLongObject*)x)->ob_digit;
28878 switch (Py_SIZE(x)) {
28879 case 0:
return (
char) 0;
28880 case -1: __PYX_VERIFY_RETURN_INT(
char, sdigit, (sdigit) (-(sdigit)digits[0]))
28881 case 1: __PYX_VERIFY_RETURN_INT(
char, digit, +digits[0])
28883 if (8 *
sizeof(
char) - 1 > 1 * PyLong_SHIFT) {
28884 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28885 __PYX_VERIFY_RETURN_INT(
char,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28886 }
else if (8 *
sizeof(
char) - 1 > 2 * PyLong_SHIFT) {
28887 return (
char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
28892 if (8 *
sizeof(
char) > 1 * PyLong_SHIFT) {
28893 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28894 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28895 }
else if (8 *
sizeof(
char) - 1 > 2 * PyLong_SHIFT) {
28896 return (
char) ((((((char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
28901 if (8 *
sizeof(
char) - 1 > 2 * PyLong_SHIFT) {
28902 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28903 __PYX_VERIFY_RETURN_INT(
char,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28904 }
else if (8 *
sizeof(
char) - 1 > 3 * PyLong_SHIFT) {
28905 return (
char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (
char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28910 if (8 *
sizeof(
char) > 2 * PyLong_SHIFT) {
28911 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28912 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28913 }
else if (8 *
sizeof(
char) - 1 > 3 * PyLong_SHIFT) {
28914 return (
char) ((((((((char)digits[2]) << PyLong_SHIFT) | (
char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28919 if (8 *
sizeof(
char) - 1 > 3 * PyLong_SHIFT) {
28920 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28921 __PYX_VERIFY_RETURN_INT(
char,
long, -(
long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28922 }
else if (8 *
sizeof(
char) - 1 > 4 * PyLong_SHIFT) {
28923 return (
char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (
char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
28928 if (8 *
sizeof(
char) > 3 * PyLong_SHIFT) {
28929 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28930 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28931 }
else if (8 *
sizeof(
char) - 1 > 4 * PyLong_SHIFT) {
28932 return (
char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (
char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
28938 if (
sizeof(
char) <=
sizeof(long)) {
28939 __PYX_VERIFY_RETURN_INT_EXC(
char,
long, PyLong_AsLong(x))
28940 #ifdef HAVE_LONG_LONG
28941 }
else if (
sizeof(
char) <=
sizeof(PY_LONG_LONG)) {
28942 __PYX_VERIFY_RETURN_INT_EXC(
char, PY_LONG_LONG, PyLong_AsLongLong(x))
28947 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
28948 PyErr_SetString(PyExc_RuntimeError,
28949 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
28952 PyObject *
v = __Pyx_PyNumber_IntOrLong(x);
28953 #if PY_MAJOR_VERSION < 3
28954 if (likely(
v) && !PyLong_Check(
v)) {
28956 v = PyNumber_Long(tmp);
28961 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
28962 unsigned char *bytes = (
unsigned char *)&val;
28963 int ret = _PyLong_AsByteArray((PyLongObject *)
v,
28964 bytes,
sizeof(val),
28965 is_little, !is_unsigned);
28975 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
28976 if (!tmp)
return (
char) -1;
28977 val = __Pyx_PyInt_As_char(tmp);
28982 PyErr_SetString(PyExc_OverflowError,
28983 "value too large to convert to char");
28985 raise_neg_overflow:
28986 PyErr_SetString(PyExc_OverflowError,
28987 "can't convert negative value to char");
28992 static int __Pyx_check_binary_version(
void) {
28993 char ctversion[4], rtversion[4];
28994 PyOS_snprintf(ctversion, 4,
"%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
28995 PyOS_snprintf(rtversion, 4,
"%s", Py_GetVersion());
28996 if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
28998 PyOS_snprintf(message,
sizeof(message),
28999 "compiletime version %s of module '%.100s' "
29000 "does not match runtime version %s",
29001 ctversion, __Pyx_MODULE_NAME, rtversion);
29002 return PyErr_WarnEx(NULL, message, 1);
29008 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
29010 #if PY_MAJOR_VERSION < 3
29011 if (t->is_unicode) {
29012 *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
29013 }
else if (t->intern) {
29014 *t->p = PyString_InternFromString(t->s);
29016 *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
29019 if (t->is_unicode | t->is_str) {
29021 *t->p = PyUnicode_InternFromString(t->s);
29022 }
else if (t->encoding) {
29023 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
29025 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
29028 *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
29033 if (PyObject_Hash(*t->p) == -1)
29040 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char* c_str) {
29041 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
29043 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject* o) {
29045 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
29047 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
29048 #if !CYTHON_PEP393_ENABLED
29049 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
29051 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
29052 if (!defenc)
return NULL;
29053 defenc_c = PyBytes_AS_STRING(defenc);
29054 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
29056 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
29058 for (
c = defenc_c;
c < end;
c++) {
29059 if ((
unsigned char) (*
c) >= 128) {
29060 PyUnicode_AsASCIIString(o);
29066 *length = PyBytes_GET_SIZE(defenc);
29070 static CYTHON_INLINE
const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
29071 if (unlikely(__Pyx_PyUnicode_READY(o) == -1))
return NULL;
29072 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
29073 if (likely(PyUnicode_IS_ASCII(o))) {
29074 *length = PyUnicode_GET_LENGTH(o);
29075 return PyUnicode_AsUTF8(o);
29077 PyUnicode_AsASCIIString(o);
29081 return PyUnicode_AsUTF8AndSize(o, length);
29086 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
29087 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
29089 #
if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
29090 __Pyx_sys_getdefaultencoding_not_ascii &&
29092 PyUnicode_Check(o)) {
29093 return __Pyx_PyUnicode_AsStringAndSize(o, length);
29096 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
29097 if (PyByteArray_Check(o)) {
29098 *length = PyByteArray_GET_SIZE(o);
29099 return PyByteArray_AS_STRING(o);
29104 int r = PyBytes_AsStringAndSize(o, &result, length);
29105 if (unlikely(
r < 0)) {
29112 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject* x) {
29113 int is_true = x == Py_True;
29114 if (is_true | (x == Py_False) | (x == Py_None))
return is_true;
29115 else return PyObject_IsTrue(x);
29117 static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
29119 if (unlikely(!x))
return -1;
29120 retval = __Pyx_PyObject_IsTrue(x);
29124 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result,
const char* type_name) {
29125 #if PY_MAJOR_VERSION >= 3
29126 if (PyLong_Check(result)) {
29127 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
29128 "__int__ returned non-int (type %.200s). "
29129 "The ability to return an instance of a strict subclass of int "
29130 "is deprecated, and may be removed in a future version of Python.",
29131 Py_TYPE(result)->tp_name)) {
29138 PyErr_Format(PyExc_TypeError,
29139 "__%.4s__ returned non-%.4s (type %.200s)",
29140 type_name, type_name, Py_TYPE(result)->tp_name);
29144 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
29145 #if CYTHON_USE_TYPE_SLOTS
29146 PyNumberMethods *m;
29148 const char *name = NULL;
29149 PyObject *res = NULL;
29150 #if PY_MAJOR_VERSION < 3
29151 if (likely(PyInt_Check(x) || PyLong_Check(x)))
29153 if (likely(PyLong_Check(x)))
29155 return __Pyx_NewRef(x);
29156 #if CYTHON_USE_TYPE_SLOTS
29157 m = Py_TYPE(x)->tp_as_number;
29158 #if PY_MAJOR_VERSION < 3
29159 if (m && m->nb_int) {
29161 res = m->nb_int(x);
29163 else if (m && m->nb_long) {
29165 res = m->nb_long(x);
29168 if (likely(m && m->nb_int)) {
29170 res = m->nb_int(x);
29174 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
29175 res = PyNumber_Int(x);
29179 #if PY_MAJOR_VERSION < 3
29180 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
29182 if (unlikely(!PyLong_CheckExact(res))) {
29184 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
29187 else if (!PyErr_Occurred()) {
29188 PyErr_SetString(PyExc_TypeError,
29189 "an integer is required");
29193 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
29196 #if PY_MAJOR_VERSION < 3
29197 if (likely(PyInt_CheckExact(b))) {
29198 if (
sizeof(Py_ssize_t) >=
sizeof(
long))
29199 return PyInt_AS_LONG(b);
29201 return PyInt_AsSsize_t(b);
29204 if (likely(PyLong_CheckExact(b))) {
29205 #if CYTHON_USE_PYLONG_INTERNALS
29206 const digit* digits = ((PyLongObject*)b)->ob_digit;
29207 const Py_ssize_t size = Py_SIZE(b);
29208 if (likely(__Pyx_sst_abs(size) <= 1)) {
29209 ival = likely(size) ? digits[0] : 0;
29210 if (size == -1) ival = -ival;
29215 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
29216 return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
29220 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
29221 return -(Py_ssize_t) (((((
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29225 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
29226 return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29230 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
29231 return -(Py_ssize_t) (((((((
size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
29235 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
29236 return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (
size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
29240 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
29241 return -(Py_ssize_t) (((((((((
size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29247 return PyLong_AsSsize_t(b);
29249 x = PyNumber_Index(b);
29251 ival = PyInt_AsSsize_t(x);
29255 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b) {
29256 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
29258 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t ival) {
29259 return PyInt_FromSize_t(ival);